Comments (5)
I am not sure what you exactly mean.
Do you mean coloring black-and-white images like this?
Or do you mean creating realistic photos from simple greyscale outline, like [this][(https://cg.cs.tsinghua.edu.cn/montage/main.htm) or edges2cats
section of this?
Both are somewhat different from the scope of SPADE. To achieve any of these methods, you will need to modify the code a bit. Most likely, you will want to remove the code block that creates a one-hot vector from semantic class label. You will want to just use the unmodified B&W input.
from spade.
Could you please help me with my problem?
I'm fairly new to Deep Learning, and I'm trying to solve a colorization problem.
Now I'm using AI Notebooks at Google Cloud, and I have some small images and their BW sketch versions.
I guess there are no instance maps in this case, and I deleted the one-hot vector block like taesungp said in the post above. However, when I try to train my model, it gives this output:
train.py --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/
dataset [CustomDataset] of size 541 was created
Network [SPADEGenerator] was created. Total number of parameters: 92.4 million. To see the architecture, do print(network).
Network [MultiscaleDiscriminator] was created. Total number of parameters: 1.4 million. To see the architecture, do print(network).
create web directory ./checkpoints/experiment/web...
Traceback (most recent call last):
File "train.py", line 34, in
for i, data_i in enumerate(dataloader, start=iter_counter.epoch_iter):
File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/jupyter/SPADE/data/pix2pix_dataset.py", line 81, in getitem
instance_path = self.instance_paths[index]
IndexError: list index out of range
The code tries to go through the indices of instance_paths, but I used the "--no_instance" option, and I shouldn't even have them. So I have an empty list of instance paths, and I can't enumerate them.
Can you see what's wrong with my code and correct it?
! python -m data.custom_dataset --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/ --no_instance
! python train.py --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/
Thanks in advance!
from spade.
I guess what I meant was using SPADE to generate art, just like in the youtube video. This is for a class to use Machine Learning to generate art. My input image is here: https://drive.google.com/file/d/1yyNBhciG8O-xkA9LELDx0iCOS1Pd1fJR/view?usp=sharing
What steps would I have to follow to create a landscape using the image above? I tried turning this image into B&W and put it in the datasets/coco_stuff/val_label
and datasets/coco_stuff/val_inst
directories, but got the following error:
RuntimeError: Invalid index in scatter at /Users/soumith/b101_2/2019_02_08/wheel_build_dirs/wheel_3.6/pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:546
Any help would be greatly appreciated. Thanks a ton!
from spade.
@MalharJ I think that trouble in your mask - it has labels equal 190 and 254, although in COCO-stuff number of input labels equal 182 and SPADE can't create one-hot vector from your mask.
from spade.
Could you please help me with my problem?
I'm fairly new to Deep Learning, and I'm trying to solve a colorization problem. Now I'm using AI Notebooks at Google Cloud, and I have some small images and their BW sketch versions.
I guess there are no instance maps in this case, and I deleted the one-hot vector block like taesungp said in the post above. However, when I try to train my model, it gives this output:
train.py --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/
dataset [CustomDataset] of size 541 was created
Network [SPADEGenerator] was created. Total number of parameters: 92.4 million. To see the architecture, do print(network).
Network [MultiscaleDiscriminator] was created. Total number of parameters: 1.4 million. To see the architecture, do print(network).
create web directory ./checkpoints/experiment/web...
Traceback (most recent call last):
File "train.py", line 34, in
for i, data_i in enumerate(dataloader, start=iter_counter.epoch_iter):
File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/jupyter/SPADE/data/pix2pix_dataset.py", line 81, in getitem
instance_path = self.instance_paths[index]
IndexError: list index out of rangeThe code tries to go through the indices of instance_paths, but I used the "--no_instance" option, and I shouldn't even have them. So I have an empty list of instance paths, and I can't enumerate them.
Can you see what's wrong with my code and correct it?
! python -m data.custom_dataset --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/ --no_instance ! python train.py --name experiment --dataset_mode custom --label_dir /home/jupyter/SPADE/labels/ --image_dir /home/jupyter/SPADE/images/
Thanks in advance!
Hi @nkaufie , did you solve the problem? I got the same situation with you. I was trying to do RGB2RGB translated task, but struggling with this error. Any helps I will very appreciate it ! Thanks
from spade.
Related Issues (20)
- How can I run this using RGB label as input ? HOT 4
- CUDA error: device-side assert triggered HOT 1
- Two update_learning_rate with same name
- RuntimeError: cublas runtime error : an access to GPU memory space failed at
- Converting to onnx HOT 2
- Choice between multi-scale discriminator and progrssive growing of GANs ?
- How many categories have you predicted for flickr data using deeplab?
- How "label_nc" in the setting works? HOT 2
- CUDA Error?? HOT 4
- Public API
- Extend to instance segmentation
- IndexError with custom dataset HOT 2
- errors with custom dataset HOT 3
- how to prepare the custom datasets?
- Issue a black background is added to the transparent image HOT 1
- GauGAN2 Paper HOT 1
- add --tf_log , program can not run HOT 1
- any pretrained models on ade20k or cityscapes with use_vae?
- Online demo app no longer on nvidia site?
- Training the model for Image to Image translation without label_nc and instance maps.
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 spade.