-
Notifications
You must be signed in to change notification settings - Fork 15
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
model already load,but the error is model is not loaded #2
Comments
Hi @C4712 Are you working locally? Are you using a custom model? Can you check the yolov7_model_path variable? |
Hi ! |
Can you share the error message? Are you using the colab file? |
Are you using the ipynb file? https://github.com/kadirnar/Yolov7-SAHI/blob/main/demo/inference_for_yolov7.ipynb |
Same Issue |
Resolved ! |
I have an internet connection already. Do you use custom model? The original yolov7.pt works for me. But my custom model doesnt work |
I did yolov7 training on my custom dataset, so I obtain best.pt. Then I used the obtain weight (best.pt renamed yolov7.pt) in SAHI. Do you have the exact same error (Model is not loaded ) ? |
Does the error go away when I type the filename yolov7.pt? |
@kadirnar no, the filename have no effect on this issue (for my case). I changed the filename to something different to "yolov7.pt" and it works too. |
In model.py file, in "class Yolov7DetectionModel(DetectionModel):" they used torch.hub.load(...) but In my case i have good internet connection still i got error |
@pythoncodeAshisH, can you share the code section which gives you this error please ? |
@IdrissSinapan974 Sure....! |
@pythoncodeAshisH Can you try to load your custom model using Yolov7_hubconf? This bug is related to the yolov7 repo. To fix this, we can open a Pull Request. |
@pythoncodeAshisH Hey, I am also getting error from the predictor which is on the beginning of the notebook. Use the prediction function which is at the end of the notebook. I shared a screenshot below. Use that |
@pythoncodeAshisH Try to do like @beratersari suggested it should work. There is different way to use SAHI (for only one picture, or a folder containing a lot of pictures). |
I am trying to use the instant segment model yolov7-seg.pt in sahi |
@pythoncodeAshisH |
Updated SAHI version and added yolov7 pip support. Yolov7Pip(Class): https://github.com/kadirnar/Yolov7-SAHI/blob/main/sahi/models/yolov7pip.py Demo_Code: Yolov7_Demo: https://github.com/kadirnar/Yolov7-SAHI/blob/main/demo/yolov7_demo.py |
Hi, getting the same error using the older version of this repo. When I use updated version with yolov7hub or yolov7pip, it automatically downloads a traced.pt and does not load my custom model. Earlier, it was working fine. Not sure what to try next. result = get_sliced_prediction( |
I am getting the same error with the new version. It is unable to load a custom model. |
Can you share the sahi and yolov7 versions? |
sahi: 0.11.6 |
Where are you running the demo.py file? You have to run it in the yolov7-sahi/ directory. It may throw an error in the demo folder.
|
I am not using it inside sahi/directory. I have installed your repo using "python setup.py install", and used it in a script. |
Orijinal Repo: https://github.com/obss/sahi
Open a new python file and run the following codes: Yolov7: https://github.com/kadirnar/Yolov7-SAHI/blob/main/demo/yolov7_demo.py You have to run these files in the yolov7-sahi folder. |
how resolve this problem? |
How did you install? What is the error message? @CesareDavidePace |
Did you run the example yolov7-demo.py file inside the Yolov7-SAHİ folder? |
I was facing a similar problem. In my scenario, I had to use yolov7-sahi in my project. Therefore I cannot use yolov7-demo.py from inside the yolov7-sahi folder. But the previous version of this repository works fine with custom models and runs from outside the yolov7-sahi folder after installation. Old Version |
@danial880 @CesareDavidePace ,
Env:yolov7detect==0.3.1 Run
Result: |
This week I will add the SAHI algorithm to this library. You will use it more easily. |
https://github.com/kadirnar/Yolov7-SAHI/blob/main/yolov7_demo.py You should use this code. |
Did the yolov7.pt file download while running this file? Can you print for the self.model_path variable on line 20 of the Yolov7pip.py file? |
Yes, the file has been downloaded. But in my file i have the same problem |
Okay I restarted the kernel and everything works fine now. Thanks for your huge help! |
This is great. This week I will release the pip package for the yolov7-sahi repository. Good luck. |
The text was updated successfully, but these errors were encountered: