aurora95 / Keras-FCN

Keras-tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation(Unfinished)
MIT License
650 stars 268 forks source link

Where did you find the .h5 weights file? #10

Closed CreatCodeBuild closed 7 years ago

CreatCodeBuild commented 7 years ago

Is the .h5 weights file downloaded from somewhere else? Or did you train your weights?

For example in model.py

weights_path = os.path.expanduser(os.path.join('~', '.keras/models/fcn_vgg16_weights_tf_dim_ordering_tf_kernels.h5'))
model.load_weights(weights_path, by_name=True)
return model

Based on the file path .keras/, it looks like a weights file come from Keras. But I am not aware of that keras provides fcn weights.

SCP-173-cool commented 7 years ago

you can review the utils/get_weights_path.py and utils/transfer_FCN.py

CreatCodeBuild commented 7 years ago

If I understand it correctly,

TF_WEIGHTS_PATH = 'https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5'

This is only the normal vgg16 weights on ImageNet? Therefore, there is no transpose convolution layer's weights?

SCP-173-cool commented 7 years ago

I guess you should read the codes first. The model used Linear Upsample instead of the Deconvolution.

ahundt commented 7 years ago

@CreatCodeBuild the new README.md explains what to do, try that and if the issue is closed you can reopen if there are still problems @aurora95 you can close this issue (or maybe consider adding me as a collaborator so I can close it?)

mrgloom commented 6 years ago

https://github.com/aurora95/Keras-FCN/blob/d923eff053785e919d1099e04a27588e8127b4f6/utils/transfer_FCN.py#L77

Changed this line to if layer.name in index:

ahundt commented 6 years ago

@mrgloom can you make a pull request with that?