PavlosMelissinos / enet-keras

A keras implementation of ENet (abandoned for the foreseeable future)
MIT License
115 stars 46 forks source link

src/models/from_torch.py needs to be updated #22

Closed nedieon closed 5 years ago

nedieon commented 5 years ago

I noticed the from_torch.py was not working on my computer. It seems to be looking for the pretrained network in the wrong directory. I made the following changes to work with the current state of the git:

Starting from line 63 on src/models/from_torch.py

if name == "main": DIR_PATH = os.path.dirname(os.path.realpath(file)) torch_model = os.path.join(DIR_PATH, os.pardir, os.pardir, 'pretrained', 'model-best.net') weights = from_torch(torch_model=torch_model)

weights = [module['weight'] for module in all_enet_modules]

with open('./pretrained/torch_enet.pkl', 'wb') as fout:
    pkl.dump(obj=weights, file=fout)
PavlosMelissinos commented 5 years ago

Hello there! Thanks for your contribution! This repo is not really active but if you submit a PR that fixes the issue I'll merge it. :)