Comments (11)
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.
@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.
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.
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.
@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.
@yanxirui Hi yanxirui, I met the same problem as you, may I know whether you have solved the problem?
from ganimation.
@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.
@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.
I think you should use tensorboard 1.8
from ganimation.
BTW, can you provide a docker file about the running environment? it's really helpful
from ganimation.
Use tensorboardX version-1.1. It looks like it works.
from ganimation.
Related Issues (20)
- Is this how you would run your sample images ? HOT 2
- TypeError: iteration over a 0-d array
- Problem with Preparing annotation
- Pretrained Openface HOT 3
- About the paper figure
- A question about some loss functions in the paper
- Give “Attention” a name.
- Suggestion of using AU R-CNN instead of OpenFace for better AU detection accuracy.
- tensors must have same number of dimensions: got 2 and 3
- Attention Loss
- TypeError: Cannot handle this data type HOT 1
- when training “the loss_d_real is negative value ” is OK? and why
- Generator is different from that in paper HOT 1
- AUs as input parameter for trained model HOT 1
- IndexError: During training 0-dim tensor error HOT 2
- Can you share you train data in this paper? HOT 1
- Pretrained Model HOT 2
- Demo??
- Why the c_dim is 5 HOT 1
- How to get tar_aus in the batch ,what is the tar_aus?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ganimation.