Closed anitaweng closed 4 years ago
Oh, I didn't have this problem. It seems like that you already successfully tested 1264 batch images. And I double checked that HANDS17 test dataset has this "image_D00015173.png" image. I guess your test dataset has something wrong. Did you check that this file exists in you file folder?
Hello! Your work is nice and I try to use your code to test my own pictures,but I get some problems.
I downloaded the pretrained model and try to test with hands2017.py with my own pictures(15172 pieces of pictures and their names are "image_D00000001.png, image_D00000002.png ... image_D00015172.png" ).
All pictures I put into are gray scale.
I only changed line 37 in hands2017.py, which is testingImageDir = "my own data path".
But I got the error below:
(venv) D:\Hand\A2J\src>python hands2017.py 1264it [03:38, 9.41it/s]Traceback (most recent call last): File "hands2017.py", line 220, in main() File "hands2017.py", line 161, in main for i, (img, label) in tqdm(enumerate(test_dataloaders)): File "D:\Hand\venv\lib\site-packages\tqdm\std.py", line 1087, in iter for obj in iterable: File "D:\Hand\venv\lib\site-packages\torch\utils\data\dataloader.py", line 568, in next return self._process_next_batch(batch) File "D:\Hand\venv\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) FileNotFoundError: Traceback (most recent call last): File "D:\Hand\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "D:\Hand\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "D:\Hand\A2J\src\hands2017.py", line 133, in getitem depth = Image.open(self.ImgDir + 'image_D%08d' % (index+1) + '.png') File "D:\Hand\venv\lib\site-packages\PIL\Image.py", line 2766, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'D:/Hand/data/gray2/image_D00015173.png'
1264it [03:38, 5.79it/s]
Did I do anything wrong?
Oh, I didn't have this problem. It seems like that you already successfully tested 1264 batch images. And I double checked that HANDS17 test dataset has this "image_D00015173.png" image. I guess your test dataset has something wrong. Did you check that this file exists in you file folder?
Oh, I got it, it was my fault. I used my own dataset instead of HANDS17 test dataset. Then I will try to download HANDS17 dataset.
By the way, so can I test my own images on your testing code? Thank you so much.
The pre-trained models we provided are dataset specific, so you can test your images with HANDS17.pth, however, due to the difference between your data and HANDS17 data, I am not sure how the model will perform.
I used my own dataset instead of HANDS17 test dataset.
Weird flex but ok.
The pre-trained models we provided are dataset specific, so you can test your images with HANDS17.pth, however, due to the difference between your data and HANDS17 data, I am not sure how the model will perform.
OK, thanks.
Hello! Your work is nice and I try to use your code to test my own pictures,but I get some problems.
I downloaded the pretrained model and try to test with hands2017.py with my own pictures(15172 pieces of pictures and their names are "image_D00000001.png, image_D00000002.png ... image_D00015172.png" ).
All pictures I put into are gray scale.
I only changed line 37 in hands2017.py, which is testingImageDir = "my own data path".
But I got the error below:
(venv) D:\Hand\A2J\src>python hands2017.py 1264it [03:38, 9.41it/s]Traceback (most recent call last): File "hands2017.py", line 220, in
main()
File "hands2017.py", line 161, in main
for i, (img, label) in tqdm(enumerate(test_dataloaders)):
File "D:\Hand\venv\lib\site-packages\tqdm\std.py", line 1087, in iter
for obj in iterable:
File "D:\Hand\venv\lib\site-packages\torch\utils\data\dataloader.py", line 568, in next
return self._process_next_batch(batch)
File "D:\Hand\venv\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
FileNotFoundError: Traceback (most recent call last):
File "D:\Hand\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\Hand\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "D:\Hand\A2J\src\hands2017.py", line 133, in getitem
depth = Image.open(self.ImgDir + 'image_D%08d' % (index+1) + '.png')
File "D:\Hand\venv\lib\site-packages\PIL\Image.py", line 2766, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'D:/Hand/data/gray2/image_D00015173.png'
1264it [03:38, 5.79it/s]
Did I do anything wrong?