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

训练时出错:TypeError: <module 'torch' from '/root/miniconda3/envs/pad2/lib/python3.6/site-packages/torch/__init__.py'> is not JSON serializable #177

Open
Yuanxing-he opened this issue Jul 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Yuanxing-he
Copy link

Traceback (most recent call last):
File "main_landet.py", line 75, in
runner = Runner(cfg=cfg)
File "/root/pytorch-auto-drive-3.2.3/utils/runners/lane_det_trainer.py", line 17, in init
super().init(cfg)
File "/root/pytorch-auto-drive-3.2.3/utils/runners/base.py", line 120, in init
self.init_exp_dir(cfg, 'train')
File "/root/pytorch-auto-drive-3.2.3/utils/runners/base.py", line 93, in init_exp_dir
f.write(json.dumps(cfg, indent=4))
TypeError: <module 'torch' from '/root/miniconda3/envs/pad2/lib/python3.6/site-packages/torch/init.py'> is not JSON serializable

@voldemortX
Copy link
Owner

Traceback (most recent call last):
File "main_landet.py", line 75, in
runner = Runner(cfg=cfg)
File "/root/pytorch-auto-drive-3.2.3/utils/runners/lane_det_trainer.py", line 17, in init
super().init(cfg)
File "/root/pytorch-auto-drive-3.2.3/utils/runners/base.py", line 120, in init
self.init_exp_dir(cfg, 'train')
File "/root/pytorch-auto-drive-3.2.3/utils/runners/base.py", line 93, in init_exp_dir
f.write(json.dumps(cfg, indent=4))
TypeError: <module 'torch' from '/root/miniconda3/envs/pad2/lib/python3.6/site-packages/torch/init.py'> is not JSON serializable

@Yuanxing-he 有运行的指令不,我看下

@Yuanxing-he
Copy link
Author

python main_landet.py --train --config="/root/pytorch-auto-drive-3.2.3/configs/lane_detection/scnn/vgg16_culane.py" --mixed-precision @voldemortX

@voldemortX
Copy link
Owner

python main_landet.py --train --config="/root/pytorch-auto-drive-3.2.3/configs/lane_detection/scnn/vgg16_culane.py" --mixed-precision @voldemortX

感觉很奇怪。你的torch是正常能用的吗?

@voldemortX voldemortX added the question Further information is requested label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants