Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
9c933497
Commit
9c933497
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[script] Enable mt fix only on darwin
parent
643ae030
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!26
Multiproc data loading
Pipeline
#52285
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/ip/binseg/script/predict.py
+2
-2
2 additions, 2 deletions
bob/ip/binseg/script/predict.py
bob/ip/binseg/script/train.py
+12
-9
12 additions, 9 deletions
bob/ip/binseg/script/train.py
with
14 additions
and
11 deletions
bob/ip/binseg/script/predict.py
+
2
−
2
View file @
9c933497
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
import
os
import
tempfile
import
sys
import
multiprocessing
import
click
...
...
@@ -173,7 +173,7 @@ def predict(
else
:
multiproc_kwargs
[
"
num_workers
"
]
=
multiproc_data_loading
if
multiproc_kwargs
[
"
num_workers
"
]
>
0
:
if
multiproc_kwargs
[
"
num_workers
"
]
>
0
and
sys
.
platform
==
"
darwin
"
:
multiproc_kwargs
[
"
multiprocessing_context
"
]
=
multiprocessing
.
get_context
(
"
spawn
"
)
...
...
This diff is collapsed.
Click to expand it.
bob/ip/binseg/script/train.py
+
12
−
9
View file @
9c933497
#!/usr/bin/env python
# coding=utf-8
import
o
s
import
sy
s
import
multiprocessing
import
click
...
...
@@ -18,6 +18,7 @@ from ..utils.checkpointer import Checkpointer
from
.binseg
import
setup_pytorch_device
,
set_seeds
import
logging
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -259,7 +260,7 @@ def train(
else
:
multiproc_kwargs
[
"
num_workers
"
]
=
multiproc_data_loading
if
multiproc_kwargs
[
"
num_workers
"
]
>
0
:
if
multiproc_kwargs
[
"
num_workers
"
]
>
0
and
sys
.
platform
==
"
darwin
"
:
multiproc_kwargs
[
"
multiprocessing_context
"
]
=
multiprocessing
.
get_context
(
"
spawn
"
)
...
...
@@ -276,13 +277,13 @@ def train(
valid_loader
=
None
if
validation_dataset
is
not
None
:
valid_loader
=
DataLoader
(
dataset
=
validation_dataset
,
batch_size
=
batch_size
,
shuffle
=
False
,
drop_last
=
False
,
pin_memory
=
torch
.
cuda
.
is_available
(),
**
multiproc_kwargs
,
)
dataset
=
validation_dataset
,
batch_size
=
batch_size
,
shuffle
=
False
,
drop_last
=
False
,
pin_memory
=
torch
.
cuda
.
is_available
(),
**
multiproc_kwargs
,
)
checkpointer
=
Checkpointer
(
model
,
optimizer
,
scheduler
,
path
=
output_folder
)
...
...
@@ -297,6 +298,7 @@ def train(
if
not
ssl
:
from
..engine.trainer
import
run
run
(
model
,
data_loader
,
...
...
@@ -313,6 +315,7 @@ def train(
else
:
from
..engine.ssltrainer
import
run
run
(
model
,
data_loader
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment