Comments (10)
Hi, that looks more like a problem with your Pytorch installation. Are you sure you have the correct CUDA and CUDNN version installed for your graphic card and Pytorch version?
from consingan.
嗨,这看起来更像是您的Pytorch安装问题。您确定为图形卡和Pytorch版本安装了正确的CUDA和CUDNN版本吗?
Hi, does the current ConsinGAN environment support Pytorch 1.7?
from consingan.
I haven't tested it with Pytorch 1.7 but in general it should work (I assume at least it would give you a different error message from the one above). The error is thrown at the torch.autograd.grad() function which is why I believe it's a problem with your environment and not with the code itself.
I would suggest running the code on CPU (use flag --not_cuda
) to see if it works on CPU or if you get a more informative error message. I haven't tested it on CPU myself so you might have to add .to(torch.device('cpu'))
at some points if Pytorch raises errors about GPU/CPU mismatch.
from consingan.
I haven't tested it with Pytorch 1.7 but in general it should work (I assume at least it would give you a different error message from the one above). The error is thrown at the torch.autograd.grad() function which is why I believe it's a problem with your environment and not with the code itself.
I would suggest running the code on CPU (use flag--not_cuda
) to see if it works on CPU or if you get a more informative error message. I haven't tested it on CPU myself so you might have to add.to(torch.device('cpu'))
at some points if Pytorch raises errors about GPU/CPU mismatch.
Thank you very much. Use Flag -- Not CUDA can run.There's another question I'd like to ask you.If I want to input a single channel grayscale image for training, how should I modify the network?
from consingan.
Just set --nc_im 1
and represent your image as shape (H x W x 1), i.e. 1 channel instead of 3 for RGB
from consingan.
Just set
--nc_im 1
and represent your image as shape (H x W x 1), i.e. 1 channel instead of 3 for RG
I've got --nc_im 1, but I'm running into the following problem.
Training model (TrainedModels/07/2021_02_24_22_00_10_generation_train_depth_3_lr_scale_0.1_act_lrelu_0.05)
Training model with the following parameters:
number of stages: 6
number of concurrently trained stages: 3
learning rate scaling: 0.1
non-linearity: lrelu
Traceback (most recent call last):
File "main_train.py", line 118, in
train(opt)
File "G:\ConSinGAN\ConSinGAN\training_generation.py", line 23, in train
real = functions.adjust_scales2image(real, opt)
File "G:\ConSinGAN\ConSinGAN\functions.py", line 185, in adjust_scales2image
real = imresize(real_, opt.scale1, opt)
File "G:\ConSinGAN\ConSinGAN\imresize.py", line 52, in imresize
im = np2torch(im,opt)
File "G:\ConSinGAN\ConSinGAN\imresize.py", line 26, in np2torch
x = color.rgb2gray(x)
File "D:\Anaconda3\envs\ConSinGAN\lib\site-packages\skimage\color\colorconv.py", line 799, in rgb2gray
rgb = _prepare_colorarray(rgb[..., :3])
File "D:\Anaconda3\envs\ConSinGAN\lib\site-packages\skimage\color\colorconv.py", line 152, in _prepare_colorarray
raise ValueError(msg)
ValueError: the input array must be have a shape == (.., ..,[ ..,] 3)), got (164, 250, 1)
from consingan.
You will have to change the code slightly then to adapt to this.
Another easy work-around is to just convert your gray-scale image to a "color image" with 3 channels, e.g. with OpenCV cv2.cvtColor(gray_img, cv.CV_GRAY2RGB)
from consingan.
You will have to change the code slightly then to adapt to this.
Another easy work-around is to just convert your gray-scale image to a "color image" with 3 channels, e.g. with OpenCVcv2.cvtColor(gray_img, cv.CV_GRAY2RGB)
There are some problems when I change the code. Can you give me some advice?
from consingan.
What are the problems?
from consingan.
I had the same problem 3 days ago, and I used conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch
to unexpectedly ran it. This vision of torch is the same as SinGAN, maybe you can try it. : )
from consingan.
Related Issues (20)
- Image Animation
- fine-tune error HOT 3
- Harmonization IndexError HOT 4
- Harmonization Error HOT 2
- nan problem of SIFID calculation HOT 1
- Where was the article published HOT 1
- How to generate images like SinGan? HOT 2
- About Learning Rate Scaling HOT 1
- All the generated/Fake samples at each stages are found to be a black image.
- Hi..In my case the generated images are found to be poorer in quality (esp. local structure) unlike SINGAN HOT 1
- Running On Multiple GPUs HOT 5
- How can I trained a Grayscale image? HOT 1
- Running my images HOT 1
- Suggest to loosen the dependency on albumentations
- Hello, I have some problems.
- Reconstruction loss
- Is there a way to save ConSinGAN model training progress? HOT 1
- Is there a way to up the resolution size of the Harmonized Image? HOT 1
- Generate g higher resolution images HOT 3
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 consingan.