jwolf02 / rtdeepvo

Bachelor Thesis Project for making DeepVO working in real time
MIT License
3 stars 1 forks source link

Flownet pre-trained model #1

Open zinuok opened 3 years ago

zinuok commented 3 years ago

I'm trying to use your implementation using the pre-trained Flownet model you linked, But which file should be used? There are several files in the link, and every file causes following error:

Traceback (most recent call last): File "train_model.py", line 166, in model.load_weights(weights_file) File "/home/zinuok/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 2227, in load_weights with h5py.File(filepath, 'r') as f: File "/home/zinuok/.local/lib/python3.6/site-packages/h5py/_hl/files.py", line 408, in init swmr=swmr) File "/home/zinuok/.local/lib/python3.6/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 (file signature not found)

I think the file format is wrong. How did you use those files?

Anyway, did you get satisfactory results from your implementation? Recently I've seen several unofficial implementations of DeepVO, but none of them work. This repository is my llast hope.

Best regards, Jinwoo Jeon

jwolf02 commented 3 years ago

Hey, do you want to use flownet itself? Because I have only extracted the pretrained encoder layers for DeepVO and never used flownet as standalone.

zinuok commented 3 years ago

No, I also want to extract the pre-trained encoder layers for DeepVO, not Flownet itself.

I'm not familiar with Keras because I've only used PyTorch. When I googled it, however, some example codes show that the saved model in "*.h5" format is loaded with the 'load_weights' method. How did you do it?

jwolf02 commented 3 years ago

Take a look into the deepvo.py file. There you see that I loaded flownet with torch. Then I extracted the tensors of weights and biases and so on. Then I defined initializer classes for all the types (FN...).

jwolf02 commented 3 years ago

If I remember correctly I used the file flownetS_from_scratch.t7 from the torch folder from the link I provided.

zinuok commented 3 years ago

Really grateful :)

I was deceived by the file name and was only looking at "train_model.py". Loading the weights works fine. Now I'm gonna run your code, wishing for good results.

Thank you again