Giter Club home page Giter Club logo

Comments (11)

Blade6570 avatar Blade6570 commented on July 24, 2024 7

Not only covert it to tensor but convert to actual format (CXWXH) as follows:
I=torch.from_numpy(image_numpy).permute(2,0,1)
self._writer.add_image(sum_name, I/255, it)

from ganimation.

RegisWu avatar RegisWu commented on July 24, 2024 5

@Blade6570
I see, I replaced 'image_numpy' by 'np.transpose(image_numpy,(2,0,1))' and solved the problem.
Thank you very much.

from ganimation.

albertpumarola avatar albertpumarola commented on July 24, 2024 2

Seems this is a versions error. You are probably using Pytorch 0.4, this code was made previous to this version release. It was made for Pytorch 0.3.1.

from ganimation.

Blade6570 avatar Blade6570 commented on July 24, 2024

In this line:
File "/home/xirui/XIr/GANimation-master/utils/tb_visualizer.py", line 27, in display_current_results
self._writer.add_image(sum_name, image_numpy, it)self._writer.add_image(sum_name, image_numpy, it)

I changed the image_numpy in to tensor and normalized it between 0 to 1 which solved the problem

from ganimation.

RegisWu avatar RegisWu commented on July 24, 2024

@Blade6570
Hi, I also met the same problem. I changed the image_numpy into a tensor by using 'torch.from_numpy(image_numpy).div(255)' but still got stuck. Would you mind share your code with me?

Many thanks.

from ganimation.

RegisWu avatar RegisWu commented on July 24, 2024

@yanxirui Hi yanxirui, I met the same problem as you, may I know whether you have solved the problem?

from ganimation.

yanxirui avatar yanxirui commented on July 24, 2024

@yanxirui Hi yanxirui, I met the same problem as you, may I know whether you have solved the problem?

I find do_visuals may has no effect on the train itself so I made do_visuals = 0 before.... And I use the method @Blade6570 mentioned to solve this problem successfully. Thanks to him.

from ganimation.

yangzhikai avatar yangzhikai commented on July 24, 2024

@albertpumarola I have try pytorch 0.3.1,but it encounter a error in "display visualizer". Then I modified ganimation.py in Iine-346 def get_current_visuals(self): , and add "np.transpose(image_numpy,(2,0,1))" after numpy of OrderedDict()。
OR self._writer.add_image(sum_name, np.transpose(image_numpy,(2,0,1)), it) In "utils/tb_visualizer.py "...
I think it is caused by Different versions of tensorboardX ,not by the pytorch version。

from ganimation.

yy9669 avatar yy9669 commented on July 24, 2024

I think you should use tensorboard 1.8

from ganimation.

yy9669 avatar yy9669 commented on July 24, 2024

BTW, can you provide a docker file about the running environment? it's really helpful

from ganimation.

bmaneesh avatar bmaneesh commented on July 24, 2024

Use tensorboardX version-1.1. It looks like it works.

from ganimation.

Related Issues (20)

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.