ErwannMillon / Color-diffusion

A diffusion model to colorize black and white images
633 stars 21 forks source link

Encoder.__init__() got an unexpected keyword argument 'condition' #2

Open Dan-Kouba opened 1 year ago

Dan-Kouba commented 1 year ago

I installed everything on OSX, but I get this error when I try to run the program:

dankouba@dan-koubas-macbook-pro:~/Documents/personal/Color-diffusion$ python3 inference.py --image-path ~/Downloads/md.jpg --checkpoint ./checkpoint/md.jpg --save_path ./output Traceback (most recent call last): File "/Users/dankouba/Documents/personal/Color-diffusion/inference.py", line 37, in encoder = Encoder(**enc_config) ^^^^^^^^^^^^^^^^^^^^^ TypeError: Encoder.init() got an unexpected keyword argument 'condition'

My guess is one of the requirements needs to be pinned to a version, but they all take up the latest. Any insight you can provide?

ErwannMillon commented 1 year ago

fixed in latest commit, but you're passing a jpg image as a checkpoint. You need to pass a checkpoint path containing the pretrained weights for the models.

ErwannMillon commented 1 year ago

Also, haven't tested, but this is unlikely to work on osx. You can try by setting device to "mps", but will likely fail in silent/unexpected ways. You can also try running on cpu device, which will be v slow.

Dan-Kouba commented 1 year ago

Thanks for the insight! This was my first time trying to run the command and I wasn't clear on how to use all the arguments. Is the checkpoint something that is included or is it something I need to generate myself?

ishakbas commented 1 year ago

I have the same question about the checkpoint, because in README.md there is nothing about it

ErwannMillon commented 1 year ago

I can try to find the checkpoint, but this was just a side project, had no idea it would get this popular haha 😅 Otherwise, you can train your own checkpoint with the training script. Remember, this isn't production code, it's just a research project so there may a few issues you have to debug

Dan-Kouba commented 1 year ago

No problem at all! I'm happy to play around now that I know more about the requirements to run the script. Thanks.