jiupinjia / stylized-neural-painting

Official Pytorch implementation of the preprint paper "Stylized Neural Painting", in CVPR 2021.
https://jiupinjia.github.io/neuralpainter/
Creative Commons Zero v1.0 Universal
1.57k stars 262 forks source link

Error with Notebook #8

Closed Zumbalamambo closed 2 years ago

Zumbalamambo commented 3 years ago

It throws the following error,

initialize network with normal
pre-trained renderer does not exist...
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-11-a13d7e15e5e1> in <module>()
      1 pt = Painter(args=args)
----> 2 optimize_x(pt)

1 frames
/content/stylized-neural-painting/painter.py in _load_checkpoint(self)
     74         else:
     75             print('pre-trained renderer does not exist...')
---> 76             exit()
     77 
     78 

NameError: name 'exit' is not defined
jiupinjia commented 3 years ago

Hi @Zumbalamambo, are u running on Colab or on your local machine with command? It seems that the checkpoint loader cannot find your pretrained model. Have you downloaded and unzip the pretrained renderers first? If you are running locally, can you show me which command are you using?

cucohhh commented 3 years ago

I have the same problems, and use the command "python demo_prog.py --img_path ./test_images/apple.jpg --canvas_color 'white' --max_m_strokes 500 --max_divide 5 --renderer oilpaintbrush --renderer_checkpoint_dir checkpoints_G_oilpaintbrush --net_G zou-fusion-net"

I have downloaded and unzip the checkpoints_G_oilpaintbrush_light.zip, I want run it on my own machine, may I use some other packages or command?

jiupinjia commented 3 years ago

Hi @cucohhh, did you unzip the checkpoint zip file to the right place? You can try to move the zip file to your repo folder first before unzipping them. Please let me know whether this helps.

MorganRO8 commented 2 years ago

I had the same issue, make a copy of the notebook in drive, I just totally forgot.

amrzv commented 9 months ago

Having the same Error in colab notebook.

NameError: name 'exit' is not defined

because !unzip checkpoints_G_oilpaintbrush.zip fails

Archive:  checkpoints_G_oilpaintbrush.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of checkpoints_G_oilpaintbrush.zip or
        checkpoints_G_oilpaintbrush.zip.zip, and cannot find checkpoints_G_oilpaintbrush.zip.ZIP, period.