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

Training error #4

Closed
GreaBugs opened this issue May 25, 2023 · 4 comments
Closed

Training error #4

GreaBugs opened this issue May 25, 2023 · 4 comments

Comments

@GreaBugs
Copy link

GreaBugs commented May 25, 2023

Running train_ net.py file occurred Error: TypeError :__ init__ () Got an unexpected keyword argument 'dtype', error location is detection2/engine/train_ loop.py
May I ask if anyone has encountered the same problem? How did you solve it?

@JIAZHAOQIAN
Copy link

JIAZHAOQIAN commented May 25, 2023

This is because torch.cuda.amp.autocast() does not have the dtype parameter. Please modify "with autocast(dtype=self.precision)" to "with autocast()" to fix this problem (line 491 in detectron2/detectron2/engine/train_loop.py).

@GreaBugs
Copy link
Author

GreaBugs commented May 25, 2023

anaconda3/envs/fastinst/lib/python3.8/site-packages/shapely/set_operations.py:133: RuntimeWarning: invalid value encountered in intersection
return lib.intersection(a, b, **kwargs)

File "/anaconda3/envs/fastinst/lib/python3.8/site-packages/torch/utils/tensorboard/init.py", line 4, in
LooseVersion = distutils.version.LooseVersion

AttributeError: module 'distutils' has no attribute 'version'
As you said, what is the reason for this error now?

@JIAZHAOQIAN
Copy link

This is due to the update of setuptools. First, pip uninstall setuptools, then, pip or conda install setuptools==58.0.4.

@GreaBugs
Copy link
Author

pip uninstall setuptools
pip install setuptools==58.0.4
and
pip uninstall shapely
pip install shapely==v1.8.5

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

3 participants