Giter VIP home page Giter VIP logo

Comments (5)

dsanno avatar dsanno commented on August 16, 2024

It is usual to consume 2.5G memory.
VGG model takes a large amount of memory.
Memory usage depends on image size and you can reduce memory usage by using -w image_size(or --width image_size) option with small size.
I don't know another way to reduce memory.

from chainer-neural-style.

dovanchan avatar dovanchan commented on August 16, 2024

I know a way to reduce memory.
Try to use Adam optimizer,It will reduce the memory three times,(less than 1g),but I just know this way,I dont know how to implement it in chainer,Hopefully one day you can update it and let the user can choose Adam optimizer;

from chainer-neural-style.

dsanno avatar dsanno commented on August 16, 2024

Thank you for your reply.
Chainer supports Adam optimizer and it is easy to use it.
To use Adam, replace this line(https://github.com/dsanno/chainer-neural-style/blob/master/src/style_transfer_runner.py#L52) with optimizer = chainer.optimizers.Adam(10.0)
(I don't know the optimal learning rate for Adam optimizer, but this value seems to work.)

I've tried Adam, but memory usage is almost the same as LBFGS.

from chainer-neural-style.

dovanchan avatar dovanchan commented on August 16, 2024

Hi,Now I have tried Adam,I found that it's useful for using Adam,It just spend a half memory.
Two more question
1、Do you know how to limit the gpu usage(for example limit it in 1G) in this chainer neural style code.
2、What is the meaning of “--resolution (1,2,3)”

from chainer-neural-style.

dsanno avatar dsanno commented on August 16, 2024

1、Do you know how to limit the gpu usage(for example limit it in 1G) in this chainer neural style code.

I think Chainer doesn't have a function to limit GPU usage.
Ask Chainer developers.

2、What is the meaning of “--resolution (1,2,3)”

"resolution" means style transfer starts from small image and double the size of it some iterations.
For example --resolution 3 --width 512

  1. starts from 128px image and
  2. optimize image for some iterations and double the size of the image (to 256px)
  3. optimize image for some iterations and double the size of the image (to 512px)
  4. optimize image for some iterations and style transfer finishes.

from chainer-neural-style.

Related Issues (8)

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.