iamaaditya / image-compression-cnn

Semantic JPEG image compression using deep convolutional neural network (CNN)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errors in model.py

taowenleon opened this issue · comments

Hello, thanks for your generosity providing source codes. I got an error when I ran the train.py, which occurs in model.py in conv6_1. The error message is "KeyError". I image that VGG has no conv6_1 while the codes try to extract weights and bias from conv6_1. So should I change line 48 to if hyper.fine_tuning and name != 'conv6' and name !='conv6_1' and name != 'depth' : ?
Thank you again.

You are correct. I have pushed the fix. When using VGG for pretrained wieghts all the layers that are not in VGG needs to be there. Also note for combine_images.py I have changed the model to "2". Previous model "6" only does binary separation of qualities, not the best way to see the effectiveness of the model.

Hello, there are some errors in get_metrics.py when I set args.print_metrics = 1. Are there additional requirements for the environment? Thank you.

Hi @DaveyTao

Yes, for metrics you would need both FFMPEG and VQMT. I have fixed the code to raise exception if those commands are not found.
Get VQMT from here https://github.com/Rolinh/VQMT
FFMPEG can be installed for your linux repository (apt-get)

Please update the path for 'vqmt' executable on line number 21 of get_metrics.py

On successful execution you will see line line this

image

Param classes are in this file:
https://github.com/iamaaditya/image-compression-cnn/blob/master/params.py
Make sure to import them. If the issue is not this then paste the traceback in full, which will provide insight into the file and the source of the error.