Code Monkey home page Code Monkey logo

mxnet-gluon-style-transfer's People

Contributors

bkmgit avatar zhanghang1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mxnet-gluon-style-transfer's Issues

Error when load params

Hi, I tried the following command as you provide:

python main.py eval --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg --model models/21styles.params --content-size 1024

but got the following error:

Traceback (most recent call last):
File "main.py", line 214, in
main()
File "main.py", line 203, in main
evaluate(args)
File "main.py", line 129, in evaluate
style_model.load_params(args.model, ctx=ctx)
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/block.py", line 317, in load_params
self.prefix)
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/parameter.py", line 669, in load
"Parameter %s is missing in file %s"%(name[lprefix:], filename)
AssertionError: Parameter conv0_weight is missing in file models/21styles.params

I have checked the names of params in 21styles.params,
they are something like model.2.conv_block.2.weight, model.4.conv_block.2.bias and so on.
It seems that the net and the params are not matching.
Can you check that?
Thank you

Question about upsampled convolution

Hi Hang,
In the paper, you have proposed an upsampled convolution to replace traditional deconvolution. However, in the code, it seems that upsampling + convolution is used instead of your proposed upsampled conv. May I ask how to implement your version of upsampled convolution?

Best,
Ed

Hybrid and hybrid forward

I was trying to put a symbol into the model and save it as a symbolic network, but many of the Hybrid things only implement forward and not hybrid_forward.

I am struggling to do this myself.

do you know if anybody else has already done this as an exercise.

I am stuck on Inspiration(HybridBlock)

I was able to do Reflectance padding on my own after reading this document:

http://gluon.mxnet.io/chapter07_distributed-learning/hybridize.html

Any help would be apprieciated.

It would be a textbook example of being able to train in Python and deploy in C++

Sam

What is the default value of args.ngf

@zhanghang1989
Thanks for sharing this nice project.

I am trying to use only the evaluate method.
What value of args.ngf should I give ?
Rest all args are handled, but for this I am not able to find the default value.

fail to open "models\mxvgg.params"

hi:
I have tried to run

python main.py optim --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg

but I got an error:

LocalFileSystem: fail to open "models\mxvgg.params"

I have checked the models dir, which there is no mxvgg.params file, but it has an download_model.sh script,
then, but it only download 21styles.params no mxvgg.params.
where can i find mxvgg.params?

RGB and BGR Mistake with optim in main.py?

Line 145-148 in main.py
I think content_image is obtained in RBG fomat.
However, utils.subtract_imagenet_mean_preprocess_batch take img in BGR fomat.
Is that right?

#main.py
    content_image = utils.tensor_load_rgbimage(args.content_image,ctx, size=args.content_size, keep_asp=True)
    content_image = utils.subtract_imagenet_mean_preprocess_batch(content_image)
    style_image = utils.tensor_load_rgbimage(args.style_image, ctx, size=args.style_size)
    style_image = utils.subtract_imagenet_mean_preprocess_batch(style_image)

#utils.py
def subtract_imagenet_mean_preprocess_batch(batch):
    """Subtract ImageNet mean pixel-wise from a BGR image."""
    batch = F.swapaxes(batch,0, 1)
    (r, g, b) = F.split(batch, num_outputs=3, axis=0)

And I think a better understanding way to transform RGB to BGR or vise versa is to use:
F.swapaxes(batch,0, 1) is not that obvious.

rgb_img = bgr_img[::-1,,] # C*H*W
bgr_img = rgb_img[::-1,,] # C*H*W

Comparison with code in mx-net repository

It may be helpful to keep this code up to date with the code in the mx-net repository for example in main.py load_params has been deprecated and replaced by load_parameters. Alternatively, this repository could be archived with all further development occuring in the mx net repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.