Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tongue-diagnosis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiyang.zhou
tongue-diagnosis
Commits
7c0c1b16
Commit
7c0c1b16
authored
Jul 09, 2021
by
zhiyang.zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes
parent
103c8ddd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
train_tongue_diagnosis.py
train_tongue_diagnosis.py
+3
-1
No files found.
train_tongue_diagnosis.py
View file @
7c0c1b16
...
@@ -87,7 +87,9 @@ def get_model(model_name):
...
@@ -87,7 +87,9 @@ def get_model(model_name):
model
.
classifier
=
torch
.
nn
.
Linear
(
in_features
=
1024
,
out_features
=
NUM_CLASSES
,
bias
=
True
)
model
.
classifier
=
torch
.
nn
.
Linear
(
in_features
=
1024
,
out_features
=
NUM_CLASSES
,
bias
=
True
)
return
model
.
to
(
device
)
return
model
.
to
(
device
)
elif
model_name
==
'resnet-50'
:
elif
model_name
==
'resnet-50'
:
return
models
.
resnet50
(
pretrained
=
True
,
num_classes
=
NUM_CLASSES
)
.
to
(
device
)
model
=
models
.
resnet50
(
pretrained
=
True
)
model
.
fc
=
torch
.
nn
.
Linear
(
in_features
=
2048
,
out_features
=
NUM_CLASSES
,
bias
=
True
)
return
model
.
to
(
device
)
elif
model_name
==
'vgg19_bn'
:
elif
model_name
==
'vgg19_bn'
:
model
=
models
.
vgg19_bn
(
pretrained
=
True
)
model
=
models
.
vgg19_bn
(
pretrained
=
True
)
model
.
classifier
[
6
]
=
torch
.
nn
.
Linear
(
in_features
=
4096
,
out_features
=
NUM_CLASSES
,
bias
=
True
)
model
.
classifier
[
6
]
=
torch
.
nn
.
Linear
(
in_features
=
4096
,
out_features
=
NUM_CLASSES
,
bias
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment