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

error in classification model which i had built a few days ago #240

Closed
1 of 2 tasks
Piyush-nr-tiwari opened this issue Jan 12, 2024 · 1 comment
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@Piyush-nr-tiwari
Copy link

Search before asking

  • I have searched the Roboflow Notebooks issues and found no similar bug report.

Notebook name

classModel = YOLO("/content/Good-bad-hw-classification.pt")
img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
classResults = classModel.predict(source=img, conf=0.1)
bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

Bug

classModel = YOLO("/content/Good-bad-hw-classification.pt")
img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
classResults = classModel.predict(source=img, conf=0.1)
bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

ERROR MESSAGE:

AttributeError Traceback (most recent call last)
in <cell line: 3>()
1 classModel = YOLO("/content/Good-bad-hw-classification.pt")
2 img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
----> 3 classResults = classModel.predict(source=img, conf=0.1)
4 bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
5 good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

8 frames
/usr/local/lib/python3.10/dist-packages/PIL/Image.py in getattr(self, name)
527 deprecate("Image categories", 10, "is_animated", plural=True)
528 return self._category
--> 529 raise AttributeError(name)
530
531 @Property

AttributeError: shape

Environment

Google colab

Minimal Reproducible Example

classModel = YOLO("/content/Good-bad-hw-classification.pt")
img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
classResults = classModel.predict(source=img, conf=0.1)
bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

ERROR MESSAGE:

AttributeError Traceback (most recent call last)
in <cell line: 3>()
1 classModel = YOLO("/content/Good-bad-hw-classification.pt")
2 img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
----> 3 classResults = classModel.predict(source=img, conf=0.1)
4 bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
5 good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

8 frames
/usr/local/lib/python3.10/dist-packages/PIL/Image.py in getattr(self, name)
527 deprecate("Image categories", 10, "is_animated", plural=True)
528 return self._category
--> 529 raise AttributeError(name)
530
531 @Property

AttributeError: shape

Additional


AttributeError Traceback (most recent call last)
in <cell line: 3>()
1 classModel = YOLO("/content/Good-bad-hw-classification.pt")
2 img = '/content/drive/MyDrive/New HW models/Error message - Talk to expert.jpeg'
----> 3 classResults = classModel.predict(source=img, conf=0.1)
4 bad = round((classResults[0].probs.data.cpu().numpy()[0])*100)
5 good = round((classResults[0].probs.data.cpu().numpy()[1])*100)

8 frames
/usr/local/lib/python3.10/dist-packages/PIL/Image.py in getattr(self, name)
527 deprecate("Image categories", 10, "is_animated", plural=True)
528 return self._category
--> 529 raise AttributeError(name)
530
531 @Property

AttributeError: shape

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@Piyush-nr-tiwari Piyush-nr-tiwari added the bug Something isn't working label Jan 12, 2024
@Piyush-nr-tiwari
Copy link
Author

Had to create a new .pt file. The previous one got corrupted somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant