Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210610347
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210610347
Commits
5848721d
Commit
5848721d
authored
3 years ago
by
何向东
Browse files
Options
Downloads
Patches
Plain Diff
解决utils引用冲突
parent
645b616c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
learning_rates.py
+0
-0
0 additions, 0 deletions
learning_rates.py
main.py
+2
-7
2 additions, 7 deletions
main.py
utils/__init__.py
+0
-1
0 additions, 1 deletion
utils/__init__.py
with
2 additions
and
8 deletions
utils/
learning_rates.py
→
learning_rates.py
+
0
−
0
View file @
5848721d
File moved
This diff is collapsed.
Click to expand it.
main.py
+
2
−
7
View file @
5848721d
import
os
import
mindspore
from
mindspore
import
context
from
mindspore.context
import
ParallelMode
import
mindspore.nn
as
nn
import
mindspore.dataset
as
ds
from
PIL
import
Image
from
mindspore.train.callback
import
ModelCheckpoint
,
CheckpointConfig
from
mindspore.nn
import
Accuracy
from
mindspore.train.callback
import
TimeMonitor
,
LossMonitor
from
mindspore
import
Model
from
unet_medical.unet_model
import
UNetMedical
from
nets.deeplab_v3
import
deeplab_v3
from
dataset
import
GetDatasetGenerator
from
loss
import
SoftmaxCrossEntropyLoss
import
utils
from
learning_rates
import
exponential_lr
context
.
set_context
(
mode
=
context
.
PYNATIVE_MODE
,
save_graphs
=
False
,
device_target
=
'
Ascend
'
,
device_id
=
7
)
...
...
@@ -25,7 +20,7 @@ train_dataset_generator = GetDatasetGenerator('./datasets', 'train')
train_dataset
=
ds
.
GeneratorDataset
(
train_dataset_generator
,
[
"
data
"
,
"
label
"
],
shuffle
=
True
)
train_dataset
=
train_dataset
.
batch
(
4
,
drop_remainder
=
True
)
lr_iter
=
utils
.
learning_rates
.
exponential_lr
(
3e-5
,
20
,
0.98
,
500
,
staircase
=
True
)
lr_iter
=
exponential_lr
(
3e-5
,
20
,
0.98
,
500
,
staircase
=
True
)
net_loss
=
SoftmaxCrossEntropyLoss
(
6
,
255
)
net_opt
=
nn
.
Adam
(
net
.
trainable_params
(),
learning_rate
=
lr_iter
)
...
...
This diff is collapsed.
Click to expand it.
utils/__init__.py
deleted
100644 → 0
+
0
−
1
View file @
645b616c
from
learning_rates
import
cosine_lr
,
poly_lr
,
exponential_lr
This diff is collapsed.
Click to expand it.
Preview
0%
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