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

FileNotFoundError: [Errno 2] No such file or directory: 'market_data/trainK/0432_c5s1_105323_05.jpg.npy' #25

Closed
2110317008 opened this issue Jul 19, 2019 · 13 comments

Comments

@2110317008
Copy link

root@1123a6f58736:/home/Pose-Transfer-master/Pose-Transfer# python tool/generate_pose_map_market.py
processing 0 / 12936 ...
market_data/trainK 0432_c5s1_105323_05.jpg
Traceback (most recent call last):
File "tool/generate_pose_map_market.py", line 41, in
compute_pose(img_dir, annotations_file, save_path)
File "tool/generate_pose_map_market.py", line 39, in compute_pose
np.save(file_name, pose)
File "/usr/local/lib/python3.6/dist-packages/numpy/lib/npyio.py", line 524, in save
fid = open(file, "wb")
FileNotFoundError: [Errno 2] No such file or directory: 'market_data/trainK/0432_c5s1_105323_05.jpg.npy'

@2110317008
Copy link
Author

Another question is Python refers to the 3.* version? Does Python 2 refer to version 2.7?
I hope to get your help.

@sandhyalaxmiK
Copy link

1)for the first one create directory in market_data by:
os.mkdir(trainK)
and then run the script.
2) it is able to run in python2.7

@2110317008
Copy link
Author

Thank you very much, the first question is solved. But the address of the deepfashion dataset you provided is not available for download. Can it be provided in other ways? Also, I installed Python3, is it ok if I run python2 tool/create_pairs_dataset.py and python2 compute_coordinates.py?

@sandhyalaxmiK
Copy link

ya. you can run with python2
also install
pytorch(0.3.1)
torchvision(0.2.0) with specific versions

@sandhyalaxmiK
Copy link

you can't download high resolution images, but you can download images of resized from the given link

@2110317008
Copy link
Author

Thank you!

@2110317008
Copy link
Author

root@1123a6f58736:/home/Pose-Transfer-master/Pose-Transfer# CUDA_VISIBLE_DEVICES=0 python test.py --dataroot ./market_data/ --name market_PATN --model PATN --phase test --dataset_mode keypoint --norm batch --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG PATN --checkpoints_dir ./checkpoints --pairLst ./market_data/market-pairs-test.csv --which_epoch latest --results_dir ./results --display_id 0

Traceback (most recent call last):
File "test.py", line 33, in
for i, data in enumerate(dataset):
File "/home/Pose-Transfer-master/Pose-Transfer/data/custom_dataset_data_loader.py", line 40, in iter
for i, data in enumerate(self.dataloader):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/usr/local/lib/python3.6/dist-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 "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/Pose-Transfer-master/Pose-Transfer/data/keypoint.py", line 47, in getitem
P1_img = Image.open(P1_path).convert('RGB')
File "/usr/local/lib/python3.6/dist-packages/PIL/Image.py", line 2770, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: './market_data/test/0188_c2s2_149727_03.jpg'

When I tested on the market-1501 dataset, this error occurred. I created a testK file under ./market_data/, which is still the error!
In addition, the previously mentioned trainK and now testK represent What consciousness?

@sandhyalaxmiK
Copy link

you created testK directory. But in the error it has shown test directory...once check

@2110317008
Copy link
Author

you created testK directory. But in the error it has shown test directory...once check

At first, I changed the test to testK and then prompted no test folder. Then, I corrected it and created the testK folder. I still showed no files under the testK folder.
Would you like to tell me what awareness of trainK, train, testK and test do they represent?

@sandhyalaxmiK
Copy link

in tool/generate_pose_map_market.py,
add these lines:

img_dir = 'market_data/train' #raw train image path
img1_dir='market_data/test'
annotations_file = 'market_data/market-annotation-train.csv' #pose annotation path
annotations1_file='market_data/market-annotation-test.csv'
save_path = 'market_data/trainK' #path to store pose maps
if not os.path.exists('market_data/testK'):
os.mkdir('market_data/testK')
save1_path = 'market_data/testK'

At final line:
compute_pose(img_dir, annotations_file, save_path) #computes poses of train images
compute_pose(img1_dir, annotations1_file, save1_path) #computes poses of test images
and at last add line:

@2110317008
Copy link
Author

in tool/generate_pose_map_market.py,
add these lines:

img_dir = 'market_data/train' #raw train image path
img1_dir='market_data/test'
annotations_file = 'market_data/market-annotation-train.csv' #pose annotation path
annotations1_file='market_data/market-annotation-test.csv'
save_path = 'market_data/trainK' #path to store pose maps
if not os.path.exists('market_data/testK'):
os.mkdir('market_data/testK')
save1_path = 'market_data/testK'

At final line:
compute_pose(img_dir, annotations_file, save_path) #computes poses of train images
compute_pose(img1_dir, annotations1_file, save1_path) #computes poses of test images
and at last add line:

First of all, thank you very much for helping me answer the questions!

Root@6ebebbcf3bc8:/home/Pose-Transfer-master/Pose-Transfer# CUDA_VISIBLE_DEVICES=0 python test.py --dataroot ./market_data/ --name market_PATN --model PATN --phase test --dataset_mode keypoint --norm Batch --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG PATN --checkpoints_dir ./checkpoints --pairLst ./market_data/market-pairs-test.csv --which_epoch latest -- Results_dir ./results --display_id 0

['0817_c3s2_110903_07.jpg___0817_c6s2_105118_03.jpg']
./results/market_PATN/test_latest/images/0817_c3s2_110903_07.jpg___0817_c6s2_105118_03.jpg_vis.jpg
 Process 11999/999999 img ..
0.013043642044067383
['0797_c4s4_024910_02.jpg___0797_c6s2_103368_04.jpg']
./results/market_PATN/test_latest/images/0797_c4s4_024910_02.jpg___0797_c6s2_103368_04.jpg_vis.jpg
Root@6ebebbcf3bc8:/home/Pose-Transfer-master/Pose-Transfer#

The test is done, but I can't see the test data in the / results/ market_PATN/ test_latest folder, only the images and index.html files.

(epoch: 3, iters: 4000, time: 0.025) pair_L1loss: 7.979 D_PP: 3.312 D_PB: 3.218 pair_GANloss: 3.607 origin_L1: 3.042 perceptual: 4.937
End of epoch 3 / 700 Time Taken: 100 sec
Learning rate = 0.0002000
(epoch: 4, iters: 800, time: 0.025) pair_L1loss: 8.189 D_PP: 3.259 D_PB: 3.217 pair_GANloss: 3.651 origin_L1: 3.079 perceptual: 5.110

This is the process of training. There are still no related documents showing the results. In my opinion, if we can save this process, it would be very good!

@sandhyalaxmiK
Copy link

sandhyalaxmiK commented Jul 23, 2019 via email

@2110317008
Copy link
Author

While training model saved in checkpoints directory. If u open the images folder in test latest, u can see the results of test set.

On Tue 23 Jul, 2019, 2:05 PM 2110317008, @.> wrote: in tool/generate_pose_map_market.py, add these lines: img_dir = 'market_data/train' #raw train image path img1_dir='market_data/test' annotations_file = 'market_data/market-annotation-train.csv' #pose annotation path annotations1_file='market_data/market-annotation-test.csv' save_path = 'market_data/trainK' #path to store pose maps if not os.path.exists('market_data/testK'): os.mkdir('market_data/testK') save1_path = 'market_data/testK' At final line: compute_pose(img_dir, annotations_file, save_path) #computes poses of train images compute_pose(img1_dir, annotations1_file, save1_path) #computes poses of test images and at last add line: First of all, thank you very much for helping me answer the questions! @.:/home/Pose-Transfer-master/Pose-Transfer# CUDA_VISIBLE_DEVICES=0 python test.py --dataroot ./market_data/ --name market_PATN --model PATN --phase test --dataset_mode keypoint --norm Batch --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG PATN --checkpoints_dir ./checkpoints --pairLst ./market_data/market-pairs-test.csv --which_epoch latest -- Results_dir ./results --display_id 0 ['0817_c3s2_110903_07.jpg___0817_c6s2_105118_03.jpg'] ./results/market_PATN/test_latest/images/0817_c3s2_110903_07.jpg___0817_c6s2_105118_03.jpg_vis.jpg Process 11999/999999 img .. 0.013043642044067383 ['0797_c4s4_024910_02.jpg___0797_c6s2_103368_04.jpg'] ./results/market_PATN/test_latest/images/0797_c4s4_024910_02.jpg___0797_c6s2_103368_04.jpg_vis.jpg @.***:/home/Pose-Transfer-master/Pose-Transfer# The test is done, but I can't see the test data in the / results/ market_PATN/ test_latest folder, only the images and index.html files. (epoch: 3, iters: 4000, time: 0.025) pair_L1loss: 7.979 D_PP: 3.312 D_PB: 3.218 pair_GANloss: 3.607 origin_L1: 3.042 perceptual: 4.937 End of epoch 3 / 700 Time Taken: 100 sec Learning rate = 0.0002000 (epoch: 4, iters: 800, time: 0.025) pair_L1loss: 8.189 D_PP: 3.259 D_PB: 3.217 pair_GANloss: 3.651 origin_L1: 3.079 perceptual: 5.110 This is the process of training. There are still no related documents showing the results. In my opinion, if we can save this process, it would be very good! — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#25?email_source=notifications&email_token=AK2XG5ROQSWXRUDBPPDSIQLQA27EXA5CNFSM4IFBUZQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2SLODA#issuecomment-514111244>, or mute the thread https://github.com/notifications/unsubscribe-auth/AK2XG5RPILBUN37SQPTXHJDQA27EXANCNFSM4IFBUZQA .

Since I have completed the training and testing, I can't find the accuracy and map in the above file (or all the files).
Where is the final accuracy value and map saved?
Which file is the training and test process and results saved?

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