Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
prenet
Project
Project
Details
Activity
Releases
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
lishen
prenet
Commits
24cbc648
Commit
24cbc648
authored
May 30, 2023
by
lishen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]
parent
5c376a4c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
main.py
main.py
+5
-5
No files found.
main.py
View file @
24cbc648
...
@@ -12,8 +12,8 @@ import torch.backends.cudnn as cudnn
...
@@ -12,8 +12,8 @@ import torch.backends.cudnn as cudnn
import
re
import
re
from
utils
import
*
from
utils
import
*
# os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3,4
"
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
=
"0,1,2,3
"
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
=
"0"
#
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def
parse_option
():
def
parse_option
():
...
@@ -173,7 +173,7 @@ def main():
...
@@ -173,7 +173,7 @@ def main():
elif
args
.
dataset
==
"food2k"
:
elif
args
.
dataset
==
"food2k"
:
NUM_CATEGORIES
=
2000
NUM_CATEGORIES
=
2000
elif
args
.
dataset
==
"jkyy"
:
elif
args
.
dataset
==
"jkyy"
:
NUM_CATEGORIES
=
17
88
NUM_CATEGORIES
=
17
90
elif
args
.
dataset
==
"test"
:
elif
args
.
dataset
==
"test"
:
NUM_CATEGORIES
=
5
NUM_CATEGORIES
=
5
...
@@ -214,8 +214,8 @@ def main():
...
@@ -214,8 +214,8 @@ def main():
cudnn
.
benchmark
=
True
cudnn
.
benchmark
=
True
net
.
cuda
()
net
.
cuda
()
# device_ids = [0, 1, 2, 3, 4
]
device_ids
=
[
0
,
1
,
2
,
3
]
device_ids
=
[
0
]
#
device_ids = [0]
# net = nn.DataParallel(net).to(device_ids)
# net = nn.DataParallel(net).to(device_ids)
net
=
nn
.
DataParallel
(
net
,
device_ids
=
device_ids
)
net
=
nn
.
DataParallel
(
net
,
device_ids
=
device_ids
)
# optimizer = nn.DataParallel(optimizer, device_ids=device_ids)
# optimizer = nn.DataParallel(optimizer, device_ids=device_ids)
...
...
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