SerialLain3170 / adeleine

Automatic line art colorization using various types of hint or without hint
Other
355 stars 47 forks source link

I got an error in reference_scft #20

Closed Foresiver5555 closed 2 years ago

Foresiver5555 commented 2 years ago

Nice to meet you, thank you for your wonderful research. I wanted to execute "reference_scft", so I prepared two types of datasets, a part of danbooru and a line drawing extracted using Anime2sSketch. When I woke up in "reference_scft / original" and "reference_scft / sketch" respectively and executed train.py,

dataset length: 1379
Traceback (most recent call last):
  File "train.py", line 202, in <module>
    trainer()
  File "train.py", line 156, in __call__
    v_list = self._valid_prepare(self.dataset,
  File "train.py", line 82, in _valid_prepare
    c_val, l_val = dataset.valid(validsize)
  File "/workspace/Colorization-master/reference_scft/dataset.py", line 154, in valid
    line = self.line_process(color_path)
  File "/workspace/Colorization-master/reference_scft/hint_processor.py", line 164, in __call__
    x = process(x)
  File "/workspace/Colorization-master/reference_scft/hint_processor.py", line 23, in __call__
    return self.exec(thing)
  File "/workspace/Colorization-master/reference_scft/hint_processor.py", line 139, in exec
    img = self._blend_preprocess(path, self.blend)
  File "/workspace/Colorization-master/reference_scft/hint_processor.py", line 122, in _blend_preprocess
    penc_line = self.pre_intensity.exec(penc_line)
  File "/workspace/Colorization-master/reference_scft/hint_processor.py", line 44, in exec
    img = (const * (img ** self.intensity))
TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'float'

I got an error and couldn't work well. Amateur Question I'm sorry, but do you have any idea how to solve it?

The image size used was 512 * 512, and the file names were the same for data and sketch.

Also, I am asking questions in English using translation, but I would like to ask in Japanese if it is okay.

Foresiver5555 commented 2 years ago

I tried various things here and it was solved.

I'm sorry for making a noise.

SerialLain3170 commented 2 years ago

Thank you for the issue!

If you do not mind, would you tell us how to solve the problem? I would like to know the solution in order to avoid happening again.

Foresiver5555 commented 2 years ago

I don't know exactly what caused it and why it was cured, but After re-preparing the dataset, I changed the layout from "reference_scft / original / 0000" and "reference_scft / sketch / 0000" to "reference_scft / original" and "reference_scft / sketch"and it worked. I think this was not able to prepare and load the dataset correctly.

SerialLain3170 commented 2 years ago

Thank you for taking time. I see what you tried.