Open pritam-dey3 opened 1 year ago
Following this reply, I added two lines in yolo.py
if isinstance(m, nn.Upsample):
m.recompute_scale_factor = False
And it solved the issue.
Following this reply, I added two lines in yolo.py
if isinstance(m, nn.Upsample): m.recompute_scale_factor = False
And it solved the issue. @pritam-dey3 You should tell that where to put these lines.
I downgraded my pytorch version to 1.11.0 but still faced this error, I downgraded pytorch to 1.10.1 and it solved the error. I used this command specifically: "conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge"
@hamzanaeem1999
I install pytorch under follow command
# CUDA 11.3
pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
this torch version had a bug(?) so had to fix it
go to your anaconda env and fix torch/nn/modules/upsampling.py e.g. /home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/nn/modules/upsampling.py
line 152~154 shoud like this now
def forward(self, input: Tensor) -> Tensor:
return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,)
p.s. got this fix from TheCodingBug
Hi, I tried to clone
mask
branch and reproduce the results intools/instance.ipynb
. And got the following errortorch version: 1.12.1 cuda version: 11.7
This issue could be duplicate of #520