cross-domain-detection icon indicating copy to clipboard operation
cross-domain-detection copied to clipboard

Problem in dataset clipart

Open chenf99 opened this issue 5 years ago • 4 comments

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 avatar Feb 04 '20 13:02 chenf99

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

chenf99 avatar Feb 04 '20 13:02 chenf99

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)

naoto0804 avatar Feb 04 '20 15:02 naoto0804

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 avatar Feb 05 '20 02:02 chenf99

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

chenf99 avatar Feb 05 '20 02:02 chenf99