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

Where to download the pretrained/torch_enet.pkl file? #16

Closed
HTLife opened this issue Oct 10, 2017 · 11 comments
Closed

Where to download the pretrained/torch_enet.pkl file? #16

HTLife opened this issue Oct 10, 2017 · 11 comments

Comments

@HTLife
Copy link

HTLife commented Oct 10, 2017

 ./train.sh 
Using TensorFlow backend.
solver json: /home/rvl/code/enet-keras/config/solver.json
Preparing to train on mscoco data...
ENet has found no compatible pretrained weights! Skipping weight transfer...
Traceback (most recent call last):
  File "src/train.py", line 141, in <module>
    train(solver=solver)
  File "src/train.py", line 82, in train
    autoencoder = model.transfer_weights(autoencoder)
  File "/home/rvl/code/enet-keras/src/models/enet_unpooling/model.py", line 47, in transfer_weights
    with open(weights, 'rb') as fin:
IOError: [Errno 2] No such file or directory: '/home/rvl/code/enet-keras/src/models/enet_unpooling/../../../models/pretrained/torch_enet.pkl'
@PavlosMelissinos
Copy link
Owner

Please check my answer on #15

In short:

  1. Create a directory named pretrained, under the root of the enet-keras project
  2. Download the original pretrained weights from here
  3. Put the file in the newly created pretrained folder
  4. Run python from_torch.py in order to create the torch_enet.pkl file.

Again, I'm sorry for the terrible documentation, but I'm going to be updating that soon; I just haven't found the time yet.

@HTLife
Copy link
Author

HTLife commented Oct 10, 2017

@PavlosMelissinos Thanks for quick response!
Although from_torch.py has some related path problem, but I could easily solve it.
Now I got the torch_enet.pkl file for training.

@HTLife HTLife closed this as completed Oct 10, 2017
@PavlosMelissinos
Copy link
Owner

Check it out again if you will, I've reorganized the project and updated the readme. Hopefully it's much better now. Thanks!

@Anguse
Copy link

Anguse commented Dec 10, 2019

Please check my answer on #15

In short:

1. Create a directory named pretrained, under the root of the enet-keras project

2. Download the original pretrained weights from [here](https://www.dropbox.com/sh/dywzk3gyb12hpe5/AAD5YkUa8XgMpHs2gCRgmCVCa)

3. Put the file in the newly created `pretrained` folder

4. Run `python from_torch.py` in order to create the `torch_enet.pkl` file.

Again, I'm sorry for the terrible documentation, but I'm going to be updating that soon; I just haven't found the time yet.

The link for torch.enet.pkl is no longer valid. Any chance you could update this?

@PavlosMelissinos
Copy link
Owner

PavlosMelissinos commented Dec 10, 2019

Hey there @Anguse ,

This is an outdated ticket. I've since moved the pretrained model to github (because it's much less volatile than hosting it on my dropbox account) and created setup.sh which should download the model and run from_torch.py automatically. It' right there on README.md

It's weird to still see interest in this project after all these years as it has not really been active for a while so I'm not promising anything but let me know if it works for you and if not I'll see what I can do! :)

@Anguse
Copy link

Anguse commented Dec 10, 2019

Thanks for your quick response!

I tried running setup.sh but this gives the following error:

Traceback (most recent call last):
File "src/models/from_torch.py", line 68, in
with open(os.path.join(DIR_PATH, os.pardir, os.pardir, 'pretrained', './pretrained/torch_enet.pkl'), 'wb') as fout:
FileNotFoundError: [Errno 2] No such file or directory: '/home/harald/Documents/enet-keras/src/models/../../pretrained/./pretrained/torch_enet.pkl'

This is after the script downloads the model-best.net file.

I am attempting to run the network using cuda10 and tensorflow 1.13.1 since i need these for a RGB-D camera I want to use together with the network.

I understand, any help is much appreciated :D
I will brief you on my progress.

@PavlosMelissinos
Copy link
Owner

with open(os.path.join(DIR_PATH, os.pardir, os.pardir, 'pretrained', './pretrained/torch_enet.pkl'), 'wb') as fout:

Oh that looks like a bug indeed, heh

I'm not on my machine currently but try changing that line to

with open(os.path.join(DIR_PATH, os.pardir, os.pardir, 'pretrained', 'torch_enet.pkl'), 'wb') as fout:

If that works, I'll push a patch later 😄 👍

@Anguse
Copy link

Anguse commented Dec 10, 2019

I changed it to:

with open(os.path.join(DIR_PATH, os.pardir, os.pardir, 'pretrained', 'model-best.net'), 'wb') as fout:

after which I am able to run the setup.sh script without errors.
However when I try to run test.sh:

Traceback (most recent call last): File "src/test.py", line 123, in <module> metadata = json.load(open(eval_config_json)) FileNotFoundError: [Errno 2] No such file or directory: 'config/evaluation.json'

I noticed there is a different file in the config path: evaluation.json.default
when I replace the path with this file I receive:

Traceback (most recent call last): File "src/test.py", line 135, in <module> model = load_model(h5file, model_name) File "src/test.py", line 68, in load_model model = models.select_model(model_name) File "/home/harald/Documents/enet-keras/src/models/__init__.py", line 13, in select_model raise ValueError('Unknown model {}'.format(model_name)) ValueError: Unknown model enet

I understand and respect if you dont have time to fiddle with this since the repo is abandoned. Just let me know :)

@PavlosMelissinos
Copy link
Owner

Yeah, it complains because there is no enet option here

Just change the model name in evaluation.json to one of the valid options and you should be fine.

Do you think you could prepare a PR or two for these bugfixes?

@Anguse
Copy link

Anguse commented Dec 17, 2019

I changed it to the enet_unpooling model but after this I received the following:

OSError: Unable to open file (unable to open file: name = 'models/mscoco/enet_unpooling/weights/enet_best.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

Do I also need the weights?

Sure, as soon as I get it running I will post a pull request.

@PavlosMelissinos
Copy link
Owner

PavlosMelissinos commented Dec 17, 2019

Can you post the full stack trace?

This is what happens when you don't test your code, kids. 😅

But yeah you need to have trained a model on mscoco before you can test it.

FYI, I decided to simplify the first steps a bit: #29

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

3 participants