rayat137 / Pose_3D

Exploiting temporal information for 3D pose estimation
82 stars 10 forks source link

OSError: Unable to open file (unable to open file: name = '../cameras.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0) #8

Closed ShaminiKoravuna closed 5 years ago

ShaminiKoravuna commented 5 years ago

Hello, First of all, I would like to congratulate for such awesome work. I was trying to run the pre-trained model but I'm getting the following error:

(tfdeeplearning) D:\pose estimation test\Pose_3D\temporal_3d_release>python temporal_3d.py --use_sh --camera_frame --dropout 0.5 --load 1798202 --evaluate
trained_model\All\dropout_0.5\epochs_100\adam\lr_1e-05\linear_size1024\batch_size_32\use_stacked_hourglass\seqlen_5
Traceback (most recent call last):
  File "temporal_3d.py", line 435, in <module>
    tf.app.run()
  File "C:\Users\SHRAVAN\AppData\Local\conda\conda\envs\tfdeeplearning\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "temporal_3d.py", line 430, in main
    errpr = evaluate()
  File "temporal_3d.py", line 369, in evaluate
    rcams, vcams = cameras.load_cameras('cameras.h5', [1,5,6,7,8,9,11])
  File "D:\pose estimation test\Pose_3D\temporal_3d_release\cameras.py", line 155, in load_cameras
    with h5py.File('../cameras.h5','r') as hf:
  File "C:\Users\SHRAVAN\AppData\Local\conda\conda\envs\tfdeeplearning\lib\site-packages\h5py\_hl\files.py", line 394, in __init__
    swmr=swmr)
  File "C:\Users\SHRAVAN\AppData\Local\conda\conda\envs\tfdeeplearning\lib\site-packages\h5py\_hl\files.py", line 170, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py\h5f.pyx", line 85, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = '../cameras.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

OS: Windows Python: 3.5.4

Could you please help me out with this?

Thanks in Advance!

gangubai commented 5 years ago

give the path of whole directory instead of ../cameras.h5 only at all the places where we are giving the input of cameras.h5 file..

ShaminiKoravuna commented 5 years ago

Thanks for the response @gangubai .

I could fix that error. But I'm getting another error now.

trained_model\All\dropout_0.5\epochs_100\adam\lr_1e-05\linear_size1024\batch_size_32\use_stacked_hourglass\seqlen_5
A subdirectory or file -p already exists.
Error occurred while processing: -p.
A subdirectory or file trained_model\All\dropout_0.5\epochs_100\adam\lr_1e-05\linear_size1024\batch_size_32\use_stacked_hourglass\seqlen_5\log already exists.
Error occurred while processing: trained_model\All\dropout_0.5\epochs_100\adam\lr_1e-05\linear_size1024\batch_size_32\use_stacked_hourglass\seqlen_5\log.
Reading subject 1, action Directions
/ubc/cs/research/tracking-raid/rayat137/code/eyescream/tensorflow/pose_estimation/h36m/Training\S1\MyPoses/3D_positions\Directions*.h5
Traceback (most recent call last):
  File "temporal_3d.py", line 435, in <module>
    tf.app.run()
  File "C:\ProgramData\Anaconda3\envs\tfdeeplearning\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "temporal_3d.py", line 430, in main
    errpr = evaluate()
  File "temporal_3d.py", line 372, in evaluate
    actions, FLAGS.data_dir, FLAGS.camera_frame, rcams, vcams )
  File "D:\Research project 2.0\3d\Pose_3D\temporal_3d_release\data_util.py", line 485, in read_3d_data
    train_set = load_data( data_dir, [1, 5, 6, 7, 8], actions, dim=3 )
  File "D:\Research project 2.0\3d\Pose_3D\temporal_3d_release\data_util.py", line 177, in load_data
    assert loaded_seqs == 2, "Expecting 2 sequences, found {0} instead".format( loaded_seqs )
AssertionError: Expecting 2 sequences, found 0 instead
gangubai commented 5 years ago

I am also getting the same error...

rayat137 commented 5 years ago

Hi ShaminiKoravuna. Sorry for late response. From the error, it seems that the train path is not being set up properly. Do you get the same error when you train from the scratch?

gangubai commented 5 years ago

Yes getting the same error even if trained from scratch.

rayat137 commented 5 years ago

I see. It seems from the error message comes from reading the 3D pose data. Can you please check if the data is being read from the source properly?

ShaminiKoravuna commented 5 years ago

I have downloaded the preprocessed data from 3d -pose -baseline. The error is rectified now.

Thank you

gangubai commented 5 years ago

Hey ShaminiKoravuna can you just tell me which changes you made in the code after downloading the data from 3d -pose -baseline?? Thanks in advance!!

ShaminiKoravuna commented 5 years ago

Hello, I have just changed the the stacked hourglass network in data_util.py line 384 to StackedHourglass as in 3D pose baseline. Then it was working fine. I didn't train the model completely i'll post back if I get any errors or different results.

Skantz commented 5 years ago

More specifically, how was this fixed?

basicvisual commented 5 years ago

Hi @ShaminiKoravuna , i had the same problem and did the following changes , from 3d-pose-baseline . I copied the data folder and put it in the top folder. Changed the line , 384 as follows

dpath = os.path.join( data_dir, 'S{0}'.format(subj), 'StackedHourglass/{0}*.h5'.format(action) ) but i still see the error

/pf/Pose_3D/temporal_3d_release/data_util.py", line 450, in read_3d_data train_set = load_data( data_dir, TRAIN_SUBJECTS, actions, dim=3 ) File "/home/tm/pf/Pose_3D/temporal_3d_release/data_util.py", line 113, in load_data assert loaded_seqs == 2, "Expecting 2 sequences, found {0} instead".format( loaded_seqs ) AssertionError: Expecting 2 sequences, found 0 instead

ShaminiKoravuna commented 5 years ago

I think the data is not being read properly can you please check it once.

ecopirate commented 5 years ago

Using the Google Drive, distribution... Checking the "3D Pose Baseline to VMD" folder and comparing to this: https://github.com/ArashHosseini/3d-pose-baseline

Looks like the "data" sub-folder was missed in the Google Drive, distribution...

Suggest trying these instructions to recover it: cd "3D Pose Baseline to VMD" folder mkdir data cd data wget https://www.dropbox.com/s/e35qv3n6zlkouki/h36m.zip unzip h36m.zip rm h36m.zip

umer657 commented 4 years ago

runfile('C:/Users/waqas mushtaq/Desktop/fire-detection/predict_fire.py', wdir='C:/Users/waqas mushtaq/Desktop/fire-detection') Reloaded modules: pyimagesearch, pyimagesearch.config [INFO] loading model... Traceback (most recent call last):

File "C:\Users\waqas mushtaq\Desktop\fire-detection\predict_fire.py", line 16, in model = load_model(config.MODEL_PATH)

File "E:\anaconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\keras\engine\saving.py", line 218, in load_model f = h5py.File(filepath, mode='r')

File "E:\anaconda\envs\tensorflow_cpu\lib\site-packages\h5py_hl\files.py", line 408, in init swmr=swmr)

File "E:\anaconda\envs\tensorflow_cpu\lib\site-packages\h5py_hl\files.py", line 173, in make_fid fid = h5f.open(name, flags, fapl=fapl)

File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper

File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper

File "h5py\h5f.pyx", line 88, in h5py.h5f.open

OSError: Unable to open file (unable to open file: name = 'output\fire_detection.model', errno = 13, error message = 'Permission denied', flags = 0, o_flags = 0)

i am having this erorr while runnin trained model of fire detection from keras ..... any help will be appreciated

IvanEvan commented 4 years ago
  1. If you run a.py got the error, but you load the model.h5 in b.py
  2. Please cp model.h5 to the same level directory with a.py
  3. Edit b.py's load('xx/model.h5') to load('model.h5')

It worked for me.

charithcherry commented 3 years ago

could anyone help me in solving this error?

Traceback (most recent call last): File "create_movie.py", line 229, in tf.app.run() File "C:\Users\chaku\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Users\chaku\AppData\Local\Programs\Python\Python38\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "C:\Users\chaku\AppData\Local\Programs\Python\Python38\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "create_movie.py", line 226, in main create_movie() File "create_movie.py", line 112, in create_movie rcams, vcams = cameras.load_cameras('.\cameras.h5', [1,5,6,7,8,9,11]) File "C:\Users\chaku\Pose_3D-master\temporal_3d_release\cameras.py", line 160, in load_cameras rcams[(s, c+1)] = load_camera_params(hf, 'subject%d/camera%d/{0}' % (s,c+1) ) File "C:\Users\chaku\Pose_3D-master\temporal_3d_release\cameras.py", line 98, in load_camera_params name = "".join( [chr(item) for item in name] ) File "C:\Users\chaku\Pose_3D-master\temporal_3d_release\cameras.py", line 98, in name = "".join( [chr(item) for item in name] ) TypeError: only integer scalar arrays can be converted to a scalar index