Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
50f69e70
"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "29a8975c66860c2b0b3fa15515d3e3dd4c78d51d"
Unverified
Commit
50f69e70
authored
Jul 15, 2020
by
Jiamin
Committed by
GitHub
Jul 15, 2020
Browse files
fix: _get_max_memory when model has no attr output_device (#416)
parent
71e32749
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
mmcv/runner/hooks/logger/text.py
mmcv/runner/hooks/logger/text.py
+1
-1
No files found.
mmcv/runner/hooks/logger/text.py
View file @
50f69e70
...
@@ -50,7 +50,7 @@ class TextLoggerHook(LoggerHook):
...
@@ -50,7 +50,7 @@ class TextLoggerHook(LoggerHook):
self
.
_dump_log
(
runner
.
meta
,
runner
)
self
.
_dump_log
(
runner
.
meta
,
runner
)
def
_get_max_memory
(
self
,
runner
):
def
_get_max_memory
(
self
,
runner
):
device
=
runner
.
model
.
output_device
device
=
getattr
(
runner
.
model
,
'
output_device
'
,
None
)
mem
=
torch
.
cuda
.
max_memory_allocated
(
device
=
device
)
mem
=
torch
.
cuda
.
max_memory_allocated
(
device
=
device
)
mem_mb
=
torch
.
tensor
([
mem
/
(
1024
*
1024
)],
mem_mb
=
torch
.
tensor
([
mem
/
(
1024
*
1024
)],
dtype
=
torch
.
int
,
dtype
=
torch
.
int
,
...
...
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