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

5k.txt / 5k.part file extension #11

Closed
CF2220160244 opened this issue Sep 12, 2018 · 7 comments
Closed

5k.txt / 5k.part file extension #11

CF2220160244 opened this issue Sep 12, 2018 · 7 comments

Comments

@CF2220160244
Copy link

when i run :
~/PycharmProjects/yolov3-master$ python test.py -weights_path checkpoints/latest.pt
there is error in dataset.py:

img_all = np.stack(img_all)[:, :, :, ::-1].transpose(0, 3, 1, 2) #row 218(dataset.py)

Traceback (most recent call last):
File "test.py", line 59, in
for batch_i, (imgs, targets) in enumerate(dataloader):
File "/home/chenfei/PycharmProjects/yolov3-master/utils/datasets.py", line 218, in next
img_all = np.stack(img_all)[:, :, :, ::-1].transpose(0, 3, 1, 2) # BGR to RGB and cv2 to pytorch
File "/home/chenfei/anaconda3/lib/python3.6/site-packages/numpy/core/shape_base.py", line 349, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack

can you help me ?

@CF2220160244
Copy link
Author

i find why there is such a problem,that is in ubuntu16.04 i should use
5k.txt rather than 5k.part in test.py.

test_path = '~/coco/images/5k.txt' ###row 31

@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 13, 2018

Ah yes, be careful of the extension used here. COCO naturally downloads as 5k.part I believe, but I have the 5k.txt extension coded into codo.data. I understand your confusion. You can modify this section to point to your 5k.* file:

yolov3/test.py

Lines 27 to 30 in 68de92f

if platform == 'darwin': # MacOS (local)
test_path = data_config['valid']
else: # linux (cloud, i.e. gcp)
test_path = '../coco/5k.part'

If you are using coco.data then make sure to update these two lines as well to point to your coco directory:

yolov3/cfg/coco.data

Lines 2 to 3 in 68de92f

train=/Users/glennjocher/Downloads/DATA/coco/trainvalno5k.txt
valid=/Users/glennjocher/Downloads/DATA/coco/5k.txt

@glenn-jocher glenn-jocher changed the title error in test.py( dataset.py) 5k.txt / 5k.part file extension Sep 13, 2018
@TommeyChang
Copy link

I have tryed to download the coco dataset, but occured a problem. How I can solve it? Thank you
get_coco_dataset.sh: 31: get_coco_dataset.sh: Syntax error: "(" unexpected

@CF2220160244
Copy link
Author

thanks! @glenn-jocher

@jaelim
Copy link

jaelim commented Sep 18, 2018

This solution still does not resolve the same problem I'm having.

@jaelim
Copy link

jaelim commented Sep 24, 2018

The difficulty I'm having is that there are many hard coded directory paths in dataset.py that are conflicting with my data directory defined in my cfg file.

Also, the platform check in training.py is probably not even necessary.

@glenn-jocher
Copy link
Member

I've resolved this issue now:

  • *.part files are the local image paths (with respect to the *.part file)
  • *.txt files are the absolute image paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants