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

Problem in dataset clipart #25

Open
chenf99 opened this issue Feb 4, 2020 · 4 comments
Open

Problem in dataset clipart #25

chenf99 opened this issue Feb 4, 2020 · 4 comments

Comments

@chenf99
Copy link

chenf99 commented Feb 4, 2020

I got an AssertionError when I ran pseudo_label.py:

python pseudo_label.py --root datasets/clipart --data_type clipart --det_type ssd300 --gpu 0 --load models/clipart_dt_ssd300 --result datasets/dt_pl_clipart
32 of 500 samples, 8.59 samples/sec, ETA    0:00:54
Traceback (most recent call last):
  File "pseudo_label.py", line 95, in <module>
    main()
  File "pseudo_label.py", line 85, in main
    labeler = LabelFile(filename, img_path, dataset.actual_labels)
  File "/data/chenfan/cross-domain-detection/lib/label_file.py", line 20, in __init__
    assert(os.path.exists(imagePath))
AssertionError

and I print(img_path) got this:datasets/dt_pl_clipart/JPEGImages/322583407.jpg. Then I go to datasets/clipart and I found that 322583407 is in ImageSets/train.txt but there is no such image as 322583407.jpg in JPEGImages, I'm sure I've downloaded the dataset, so maybe there is a missing image in this dataset?

@chenf99
Copy link
Author

chenf99 commented Feb 4, 2020

@naoto0804 I'm looking forward to your reply, thank you!

@naoto0804
Copy link
Owner

naoto0804 commented Feb 4, 2020

I downloaded clipart dataset to my local PC right now and confirmed that it exists.

naoto@inouenaoto-no-MacBook-Pro:~/Downloads $ ls -lat clipart/JPEGImages | grep 322583407.jpg
-rw-r--r--     1 naoto  staff    32095 Mar 11  2018 322583407.jpg

Hmm.. have you executed bash prepare_dt_pl.sh as instructed in datasets folder?
In generating pseudo-labeled dataset, we create only annotations, images and a textfile containing the name of images are just linked statically or symbolically.
There may be two possible reasons for the error raised above;
(i) 322583407.jpg does not exist (your guess)
(ii) a parent directory datasets/dt_pl_clipart/JPEGImages does not exist (my guess, bash prepare_dt_pl.sh will create it)

@chenf99
Copy link
Author

chenf99 commented Feb 5, 2020

Thank you for your reply, I tried it again and I found 322583407.jpg does exist:

cross-domain-detection/datasets$ ls -lat clipart/JPEGImages | grep 322583407.jpg
-rw-r--r-- 1 chenfan chenfan   32095 Mar 11  2018 322583407.jpg

, but I'm sure that I have executed bash prepare_dt_pl.sh, it created a link for dt_pl_clipart/JPEGImages:

cross-domain-detection/datasets/dt_pl_clipart$ ls
Annotations  ImageSets  JPEGImages

I'm puzzled about this situation...

@chenf99
Copy link
Author

chenf99 commented Feb 5, 2020

I used stat to check what's wrong and I got this:

cross-domain-detection/datasets$ stat dt_pl_clipart/JPEGImages 
  File: 'dt_pl_clipart/JPEGImages' -> './clipart/JPEGImages'
  Size: 20              Blocks: 0          IO Block: 4096   symbolic link
Device: 811h/2065d      Inode: 212074503   Links: 1
Access: (0777/lrwxrwxrwx)  Uid: ( 1001/ chenfan)   Gid: ( 1001/ chenfan)
Access: 2020-02-04 08:34:41.880036622 -0500
Modify: 2019-12-18 02:22:39.030598453 -0500
Change: 2019-12-18 02:22:39.030598453 -0500
 Birth: -
cross-domain-detection/datasets$ stat dt_pl_clipart/JPEGImages/322583407.jpg
stat: cannot stat 'dt_pl_clipart/JPEGImages/322583407.jpg': No such file or directory

and in python, os.path.exists('datasets/dt_pl_clipart/JPEGImages/') returns False

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

2 participants