Open CuteZombie7 opened 2 years ago
The following repository has PyTorch implementations of vgg_7, upconv_7, and cunet (training does not work due to inplace_clip
gradient issue).
It is not difficult to convert to Chainer model, I think.
https://github.com/nagadomi/nunif/tree/master/nunif/models/waifu2x
Also, waifu2x-caffe supports both cunet and upresnet10. It does not support training, though.
I want to deploy the cunet model to that project, and just use it for inference. And now, the problem is how to convert t7 format to npz format. The models in that project are all in npz format.
ref. code that loads the json file into the pytorch model. https://github.com/nagadomi/nunif/blob/eab6952d93e85951ed4e4cff30cd26c09e1dbb63/nunif/models/load_save.py#L10-L28
thank you, I will have a try.
Is there any .caffemodel file of cunet? So that I can directly use CaffeFunction to convert it. I'm a novice in deep learning, it's too difficult for me to port it at the code level, because I'm familiar with neither of the frameworks.
waifu2x-caffe has it. The following threads may be helpful. https://github.com/lltcggie/waifu2x-caffe/issues/115
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "input", since CaffeFunction does not support Input layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Flatten1", since CaffeFunction does not support Flatten layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Crop1", since CaffeFunction does not support Crop layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Flatten2", since CaffeFunction does not support Flatten layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Flatten3", since CaffeFunction does not support Flatten layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Crop2", since CaffeFunction does not support Crop layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Flatten4", since CaffeFunction does not support Flatten layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Crop3", since CaffeFunction does not support Crop layer
'support %s layer' % (layer.name, layer.type))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/chainer/links/caffe/caffe_function.py:165: UserWarning: Skip the layer "Crop4", since CaffeFunction does not support Crop layer
'support %s layer' % (layer.name, layer.type))
------------------------------OK-----------------------------
2.0x scaling... Traceback (most recent call last):
File "waifu2x.py", line 270, in
It seems that caffeFunction doesn't surpport some layers. Is there any way to solve this problem? Or should i port the model at code level ? :(
I am not familiar with the chainer code, but the documentation says the following:
It does not support full compatibility against Caffe. Some layers and configurations are not implemented in Chainer yet, though the reference models provided by the BVLC team are supported except data layers. https://docs.chainer.org/en/v7.8.0/reference/generated/chainer.links.caffe.CaffeFunction.html
Also, chainer has already decided to discontinue development.
All right. I will go on to port the model at code level. Since i want to install waifu2x on a platform where torch, caffe and some other frameworks are banned, chainer is the only choice, maybe. And thanks for your help.
https://github.com/tsurumeso/waifu2x-chainer This is the Chainer implementation of waifu2x, but cunet models haven't been added to this project. Is there any way to convert original luatorch models to Chainer models? It would be very helpful to me.