Comments (4)
Hi,
it seems something goes wrong when reading your --naive_img.
Can you print the shape of the image after the image is loaded (so print(x.shape)
after x = img.imread('%s' % (opt.input_name))
)?
It should have three dimensions (width, height, channels). If the image you're loading is grayscale (black-white only) the loaded array would only have two dimensions (width, height) in which case you would have to convert the image to RGB format first before continuing.
from consingan.
Yes, the error was about the RGB/gray format. Really thank you.
I know this problem is not related to this issue and I'm going to close it soon, but now I'm getting this:
Traceback (most recent call last):
File "main_train.py", line 113, in <module>
train(opt)
File "/home/me/ConSinGAN/ConSinGAN/training_harmonization_editing.py", line 22, in train
real = functions.read_image(opt)
File "/home/me/ConSinGAN/ConSinGAN/functions.py", line 132, in read_image
x = np2torch(x,opt)
File "/home/me/ConSinGAN/ConSinGAN/functions.py", line 155, in np2torch
x = x.type(torch.cuda.FloatTensor) if not(opt.not_cuda) else x.type(torch.FloatTensor)
RuntimeError: Cannot initialize CUDA without ATen_cuda library. PyTorch splits its backend into two shared libraries: a CPU library and a CUDA library; this error has occurred because you are trying to use some CUDA functionality, but the CUDA library has not been loaded by the dynamic linker for some reason. The CUDA library MUST be loaded, EVEN IF you don't directly use any symbols from the CUDA library! One common culprit is a lack of -Wl,--no-as-needed in your link arguments; many dynamic linkers will delete dynamic library dependencies if you don't depend on any of their symbols. You can check if this has occurred by using ldd on your binary to see if there is a dependency on *_cuda.so library.
How could I solve?
from consingan.
Do you have an NVIDIA GPU on your computer or only CPU?
If you have a GPU I don't know how to fix this error as I don't know what the ATen_cuda library is. Reinstalling PyTorch from scratch via pip or conda should fix this I would hope (make sure you install it for the correct CUDA version you have on your system).
If you don't have a GPU you can add the flag --not_cuda
to run everything on CPU but this will be a lot slower. Also, to be honest, I'm not 100% sure if I have everything running on CPU, sometimes I might have just put tensors on GPU directly without checking for the --not_cuda
flag. In this case you will get an error that a tensor was expected on a different device, so you might have to fix a couple of lines to make tensors be on CPU instead of the GPU (you'll usually only have to change torch.cuda.FloatTensor
to torch.FloatTensor
or add .to(opt.device)
or .to("cpu")
to any tensors/models).
from consingan.
The --not_cuda
flag seems to be working.
Thank you again!!
from consingan.
Related Issues (20)
- Image Animation
- fine-tune error HOT 3
- 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
- Hello, I'm having some problems. RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED HOT 10
- 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.