hitfeelee / Yolo3D

perform 3D object detection base on Yolov5 and 3DDeepbox
MIT License
31 stars 6 forks source link

RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation #4

Open lilonglong-xian opened 3 years ago

lilonglong-xian commented 3 years ago

there is an error when training,do you know about this?thanks very much

python train.py --data ./datasets/configs/kitti.yaml --cfg models/configs/yolo3d_5m.yaml --weights ./weights/yolov5m.pt --batch-size 64 --epochs 2000 --is-rect --is-mosaic --multi-scale --resume --device cpu

Traceback (most recent call last): File "train.py", line 299, in train(cfg) File "train.py", line 97, in train model = Model(config).to(device) File "/media/vdb/10235744/Yolo3D-main/models/yolo.py", line 66, in init self.model, self.save = parse_model(self.md, ch=[ch]) # model, savelist, ch_out File "/media/vdb/10235744/Yolo3D-main/models/yolo.py", line 50, in parsemodel m = nn.Sequential([m(args) for _ in range(n)]) if n > 1 else m(*args) # module File "/media/vdb/10235744/Yolo3D-main/models/yolo.py", line 120, in init self._initialize_biases() File "/media/vdb/10235744/Yolo3D-main/models/yolo.py", line 184, in _initialize_biases b[:, 4] += math.log(8 / (640 / si) ** 2) # obj (8 objects per 640 image) RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation

JeffXu1 commented 3 years ago

Please change your torch and torchvision version to 1.7.1 and 0.8.2