android-demo-app icon indicating copy to clipboard operation
android-demo-app copied to clipboard

AttributeError: Can't get attribute 'C3' on <module 'models.common' from './models/common.py'

Open TehKonnos opened this issue 3 years ago • 5 comments

Hello! I run models/export.py from https://github.com/jeffxtang/yolov5 with the supposed changes and I get the error above. I have trained a binary custom yolov5 model with yolov5s.yaml. Any suggestions?

TehKonnos avatar Jul 12 '21 16:07 TehKonnos

Which torch and torchvision versions are you using?

jeffxtang avatar Jul 12 '21 18:07 jeffxtang

Torch = 1.9.0+cu102 Torchvision = 0.10.0+cu102

I noticed that it exports yolov5s.pt but not my best.pt

TehKonnos avatar Jul 12 '21 18:07 TehKonnos

Also my model is trained with --img 640 as yolov5s, but in android (if I export with ultrlytics export method) I get this:

2021-07-12 21:50:12.954 31189-31230/org.pytorch.demo.objectdetection E/Perf: Fail to get file list org.pytorch.demo.objectdetection
2021-07-12 21:50:12.954 31189-31230/org.pytorch.demo.objectdetection E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2021-07-12 21:50:12.954 31189-31230/org.pytorch.demo.objectdetection E/Perf: Fail to get file list org.pytorch.demo.objectdetection
2021-07-12 21:50:12.954 31189-31230/org.pytorch.demo.objectdetection E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2021-07-12 21:50:13.058 31189-31189/org.pytorch.demo.objectdetection E/objectdetectio: Invalid ID 0x00000000.```

TehKonnos avatar Jul 12 '21 18:07 TehKonnos

I found my solution. Tell me if it's correct. I used ultralytics/yolov5 and added the export.py in the yolov5/models directory. Still in android studio I receive the same error :/

TehKonnos avatar Jul 13 '21 21:07 TehKonnos

same error there :/

tsukasagenesis avatar Aug 03 '21 16:08 tsukasagenesis