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
yaoyuping
nnDetection
Commits
8032b8d2
Unverified
Commit
8032b8d2
authored
Feb 29, 2024
by
Michael Baumgartner
Committed by
GitHub
Feb 29, 2024
Browse files
make errors more general
parent
2aa85703
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
nndet/planning/estimator.py
nndet/planning/estimator.py
+8
-8
No files found.
nndet/planning/estimator.py
View file @
8032b8d2
...
...
@@ -191,10 +191,11 @@ class MemoryEstimatorDetection(MemoryEstimator):
device
=
torch
.
device
(
"cuda"
,
self
.
gpu_id
)
logger
.
info
(
f
"Estimating on
{
device
}
with shape
{
shape
}
and "
f
"batch size
{
self
.
batch_size
}
and num_instances
{
num_instances
}
"
)
try
:
loss
=
None
opt
=
None
inp
=
None
block_tensor
=
None
try
:
with
cudnn_deterministic
():
torch
.
cuda
.
reset_peak_memory_stats
()
network
=
network
.
to
(
device
)
...
...
@@ -237,14 +238,13 @@ class MemoryEstimatorDetection(MemoryEstimator):
scaler
.
step
(
opt
)
scaler
.
update
()
dyn_mem
=
torch
.
cuda
.
memory_reserved
()
except
(
RuntimeError
,)
as
e
:
except
Exception
as
e
:
logger
.
info
(
f
"Caught error (If out of memory error do not worry):
{
e
}
"
)
empty_mem
=
0
fixed_mem
=
float
(
'Inf'
)
dyn_mem
=
float
(
'Inf'
)
finally
:
del
loss
del
opt
del
inp
del
block_tensor
...
...
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