urban-detection
urban-detection copied to clipboard
Issue running detect.py
Thanks for share to project. I try to run the program and get an error: 'Hardswish' object has no attribute 'inplace' under the procedure: def fuseforward(self, x): return self.act(self.conv(x))
I follow the steps and install through requirements.txt. I was not able to find a solution through web search. Any idea or suggestion would be greatly appreciated.
Env:
windows 11,
Python 3.8
cuda-11.3.0
graphic card GeForce RTX 3090
Thanks in advance.
Also was having the same issue as above, please let me know if you have any tips here as I would love to run your model!
Also was having the same issue as above! Please let me know if you have any tips here as I would love to run your model!
Env: windows 10 Python 3.10 Cuda-11.3.0 Graphic card GeForce GTX 1080 x2
Hi everyone,
First of all, I apologize for the delay in answering to this issue. The people behind the original code of this repository have left the employment of the City of Montreal a while ago, and I am by no mean an expert on Python, even less so the Machine Learning libraries used in this project.
I have been able to reproduce the same issue that you all experience, so I can confirm there is indeed something wrong with the code. However, I was not able to find a fix for it.
My search on Github has led me to this open issue (with this exact stack trace) https://github.com/pytorch/pytorch/issues/46971 that seems to indicate that it would be a problem with the fact that the pre-trained models that we provide have a dependency on a specific older version of pytorch (through the use of the yolov5). I have tried every major pytorch version between 1.6.0
and 1.11.0
in the requirements.txt
(1.7, 1.8, 1.9, 1.10, 1.11) and they all exhibit the same problem.
I know for a fact that this code ran successfully in the past, so it might only be a matter of getting the exact versions of the dependencies correct. Unfortunately, I don't have access to any working environment to get those version numbers. It makes me sad that the requirements.txt
file doesn't specify strict version numbers as this would have prevented such an issue.
One potential solution would be to re-train the models with a current, up to date, version of pytorch, and then run the detect.py on it afterwards, but I have no idea how to do that.
I'm sorry that I can't be of more help. I will leave this issue open, in case somebody expands on my investigation and comes up with a working fix for it.