TensorFlow-2.x-Tutorials icon indicating copy to clipboard operation
TensorFlow-2.x-Tutorials copied to clipboard

13-DCGCN error

Open shersoni610 opened this issue 4 years ago • 1 comments

Hello,

I get the following error for 13-DCGAN program: (base)@blackhole:$ python main.py Traceback (most recent call last): File "main.py", line 5, in from scipy.misc import toimage ImportError: cannot import name 'toimage' from 'scipy.misc' (/home/csverma/Disk/Software/Anaconda3/lib/python3.7/site-packages/scipy/misc/init.py)

shersoni610 avatar Nov 24 '19 06:11 shersoni610

I ran into the same issue, and here is my solution.

toimage is deprecated in scipy since 1.0 and removed in 1.2. You have two options here:

  1. Rollback scipy to version <=1.1. Just need to tolerate some warning messages.
  2. Use PIL Image object instead: from PIL import Image ... # replace toimage call im = Image.fromarray(final_image) im.save(image_path) ...

pc2005 avatar Dec 20 '19 03:12 pc2005