Object detection problem
YOLOv4 pytorch from: GitHub - Tianxiaomo/pytorch-YOLOv4: PyTorch ,ONNX and TensorRT implementation of YOLOv4
Why when I using roboflow dataset and use it in YOLOv4 pytorch, it appears this error?
ValueError: invalid literal for int() with base 10: ‘000037_jpg.rf.5c9063a3fc4352fed0729e91f7a6f508’
Noted that I am using YOLOv4 pytorch from
GitHub - Tianxiaomo/pytorch-YOLOv4: PyTorch ,ONNX and TensorRT implementation of YOLOv4 not yours because yours didnt output mAP
Hi @MheadHero
I found the same error in the Issues
section on the repo you shared. Have you tried eg: int(float("50.00"))
? Below is the issue for reference
opened 06:14PM - 26 Jul 20 UTC
closed 01:15PM - 31 Jul 20 UTC
Hello!
Thank you for this great library! I trained the model, and I created a… demo successfully with the darknet library. Based on this I guess, that .cfg and .data files are okay. I tried to convert a darknet yolov4 model to PyTorch one, and I got this error:
```bash
Traceback (most recent call last):
File "demo.py", line 155, in <module>
detect_cv2(args.cfgfile, args.weightfile, args.imgfile)
File "demo.py", line 27, in detect_cv2
m = Darknet(cfgfile)
File "/content/pytorch-YOLOv4/tool/darknet2pytorch.py", line 144, in __init__
self.models = self.create_network(self.blocks) # merge conv, bn,leaky
File "/content/pytorch-YOLOv4/tool/darknet2pytorch.py", line 254, in create_network
filters = int(block['filters'])
ValueError: invalid literal for int() with base 10: '30 #255'
```
My cfg file: https://drive.google.com/file/d/150ow6bVbUcNcPvyh8UajDpLtgOjmr8ub/view?usp=sharing
My weights: https://drive.google.com/file/d/1-RPnDFn9_Q1z4bQKDxkcNYPoUBPAPGWT/view?usp=sharing
Library versions:
```
numpy==1.18.2
torch==1.4.0
tensorboardX==2.0
```
What causes the error?
Hi, actually I look thru all this repo already. I found that this is the issue happens when the dataset.py file want to get the unique key. And the problem now is, roboflow export the dataset with the filename of 2 types.
000133_JPG.rf.6cad57dd6917906c1577a643ebb339a1.jpg
IMG_4852_JPG.rf.3e0f1a273ca0769c5c981929159d32a0.jpg
So when it comes to a yolov4 function which is get_img_id() . The purpose of this function is to create unique key for all images.
So, how can I create my own get_img_id() to fullfil the 2 conditions from roboflow dataset?
Noted that the unique id in yolov4 must be integer.