Giter VIP home page Giter VIP logo

Comments (5)

taesungp avatar taesungp commented on July 22, 2024

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.

nkaufie avatar nkaufie commented on July 22, 2024

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.

MalharJ avatar MalharJ commented on July 22, 2024

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.

alexsannikoff avatar alexsannikoff commented on July 22, 2024

@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.

AugustLee93 avatar AugustLee93 commented on July 22, 2024

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!

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)

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.