Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
221cb0249
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Summer2022
221cb0249
Commits
66d18ad5
Commit
66d18ad5
authored
2 years ago
by
wangchangheng
Browse files
Options
Downloads
Patches
Plain Diff
fix mem of nets
parent
150b71a1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
official/cv/efficientnet/src/efficientnet.py
+1
-11
1 addition, 11 deletions
official/cv/efficientnet/src/efficientnet.py
official/cv/ssd/train.py
+0
-3
0 additions, 3 deletions
official/cv/ssd/train.py
with
1 addition
and
14 deletions
official/cv/efficientnet/src/efficientnet.py
+
1
−
11
View file @
66d18ad5
...
...
@@ -18,11 +18,9 @@ import math
import
re
from
copy
import
deepcopy
import
mindspore
as
ms
from
mindspore
import
nn
from
mindspore.common.initializer
import
(
Normal
,
One
,
Uniform
,
Zero
)
from
mindspore.ops
import
operations
as
P
from
mindspore.ops.composite
import
clip_by_value
relu
=
P
.
ReLU
()
sigmoid
=
P
.
Sigmoid
()
...
...
@@ -345,14 +343,6 @@ def _decode_arch_def(arch_def, depth_multiplier=1.0, depth_trunc='ceil'):
return
arch_args
def
hard_swish
(
x
):
x
=
P
.
Cast
()(
x
,
ms
.
float32
)
y
=
x
+
3.0
y
=
clip_by_value
(
y
,
0.0
,
6.0
)
y
=
y
/
6.0
return
x
*
y
class
BlockBuilder
(
nn
.
Cell
):
def
__init__
(
self
,
builder_in_channels
,
builder_block_args
,
channel_multiplier
=
1.0
,
channel_divisor
=
8
,
channel_min
=
None
,
pad_type
=
''
,
act_fn
=
None
,
se_gate_fn
=
sigmoid
,
se_reduce_mid
=
False
,
...
...
@@ -702,7 +692,7 @@ def _gen_efficientnet(channel_multiplier=1.0, depth_multiplier=1.0, num_classes=
channel_multiplier
=
channel_multiplier
,
num_features
=
num_features
,
bn_args
=
_resolve_bn_args
(
kwargs
),
act_fn
=
hard_s
wish
,
act_fn
=
nn
.
HS
wish
()
,
**
kwargs
)
return
model
...
...
This diff is collapsed.
Click to expand it.
official/cv/ssd/train.py
+
0
−
3
View file @
66d18ad5
...
...
@@ -125,9 +125,6 @@ def train_net():
ms
.
set_auto_parallel_context
(
all_reduce_fusion_config
=
config
.
all_reduce_fusion_config
)
rank
=
get_rank
()
# Set mempool block size in PYNATIVE_MODE for improving memory utilization, which will not take effect in GRAPH_MODE
ms
.
set_context
(
mempool_block_size
=
"
31GB
"
)
mindrecord_file
=
create_mindrecord
(
config
.
dataset
,
"
ssd.mindrecord
"
,
True
)
if
config
.
only_create_dataset
:
...
...
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