Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: expected scalar type Half but found Float #16

Closed
sanmulab opened this issue May 7, 2022 · 2 comments
Closed

RuntimeError: expected scalar type Half but found Float #16

sanmulab opened this issue May 7, 2022 · 2 comments

Comments

@sanmulab
Copy link

sanmulab commented May 7, 2022

Hello author! I seem to have a new problem now: I want to use half-precision fp16 for training, so I add the line fp16 = dict(loss_scale=512.) to the config file, but I get an error: . Does your codebase currently not support half-precision training?

error:
File "/home/ubuntu/cs_logdet/rankSortLoss-main/mmdet/models/necks/fpn_carafe.py", line 256, in forward
upsample_feat = self.upsample_modulesi - 1
File "/home/ubuntu/.conda/envs/testlogdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ubuntu/.conda/envs/testlogdet/lib/python3.7/site-packages/mmcv/ops/carafe.py", line 285, in forward
x = self.feature_reassemble(x, mask)
File "/home/ubuntu/.conda/envs/testlogdet/lib/python3.7/site-packages/mmcv/ops/carafe.py", line 277, in feature_reassemble
x = carafe(x, mask, self.up_kernel, self.up_group, self.scale_factor)
File "/home/ubuntu/.conda/envs/testlogdet/lib/python3.7/site-packages/mmcv/ops/carafe.py", line 139, in forward
scale_factor=scale_factor)
RuntimeError: expected scalar type Half but found Float

@kemaloksuz
Copy link
Owner

Hi,

Unfortunately, we have tried the code with half precision. Having checked your error message, the error may not be related to RS Loss but carafe operation in the mmdetection, however, I am not fully sure. Have you tried to run an architecture without carafe?

@sanmulab
Copy link
Author

sanmulab commented May 8, 2022

This is the case, when I add fpn_carafe, I will have this error, and I can train normally without fpn_carafe. I will go to the official to raise this issue. Thanks for answering.

@sanmulab sanmulab closed this as completed May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants