fast-style-transfer icon indicating copy to clipboard operation
fast-style-transfer copied to clipboard

Error: module 'scipy.misc' has no attribute 'imread'

Open pamruta opened this issue 4 years ago • 12 comments

Is this code up to date? Getting the following error while running script style.py

AttributeError: module 'scipy.misc' has no attribute 'imread'

pamruta avatar Mar 03 '20 12:03 pamruta

! sudo pip install --upgrade scipy==1.1.0

Solved the issue on Colab.. apparently we need older version of Scipy which has 'imread' function..

pamruta avatar Mar 04 '20 06:03 pamruta

After upgrading scipy to Version 1.1.0 I've received the error message I've received the error message

ERROR: tensorflow 2.1.0 has requirement scipy==1.4.1; python_version >= "3", but you'll have scipy 1.1.0 which is incompatible.

and after executing

python evaluate.py --checkpoint ./rain-princess.ckpt --in-path <path_to_input_file> --out-path ./output_image.jpg

I get the message

Traceback (most recent call last):
  File "evaluate.py", line 212, in <module>
    main()
  File "evaluate.py", line 199, in main
    device=opts.device)
  File "evaluate.py", line 132, in ffwd_to_img
    ffwd(paths_in, paths_out, checkpoint_dir, batch_size=1, device_t=device)
  File "evaluate.py", line 85, in ffwd
    soft_config = tf.ConfigProto(allow_soft_placement=True)
AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

Update: Solved! You just need to downgrade Tensorflow 2.x to a previous version.

RamoramaInteractive avatar Mar 19 '20 08:03 RamoramaInteractive

I'm having the same problem. I downgraded scipy to 1.1.0. Then downgraded tensorflow to 2.0.0, got the same ˛"module 'tensorflow' has no attribute 'ConfigProto'" problem. Also tried downgrading it to 1.15.0, got a lot of "Failed to place the graph without changing the devices of some resources" error.

@RamoramaInteractive @pamruta which are the correct versions of scipy and tensorflow to use with this project?

madarasz avatar Mar 20 '20 11:03 madarasz

@madarasz I meant you should downgrade Tensorflow 2.x to a Tensorflow Version 1.x. Version 1.15 works for me. I used scipy version 1.0.0, but try first to install the correct Tensorflow Version.

RamoramaInteractive avatar Mar 20 '20 18:03 RamoramaInteractive

Check this thread: https://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread

According to this, imread is no longer supported and instead we should use imageio.

souravs17031999 avatar Mar 25 '20 04:03 souravs17031999

Downgrading tensorflow to version 1.15.0 after downgrading scipy to 1.1.0 worked for me!

myaccountstlee avatar Mar 27 '20 03:03 myaccountstlee

This worked for me

!apt install ffmpeg
!pip install tensorflow==0.12.1
!pip install numpy==1.11.2
!pip install scipy==0.18.1
!pip install pillow==3.4.2

darkmarthur avatar Apr 10 '20 18:04 darkmarthur

Confirmed that downgrading scipy and tensorflow was required to run evaluate.py without errors.

Using Anaconda:

conda install scipy=1.1.0
conda install tensorflow=1.15.0

rogalskim avatar Apr 13 '20 09:04 rogalskim

Pinning scipy to 1.1.0 as suggested by @pamruta worked for me in TF2.4.1 setup.

souschefistry avatar Feb 18 '21 06:02 souschefistry

Scipy 1.1.0 and Tensorflow 1.15.0 worked for me too.

StephenRoddy avatar Jun 22 '21 19:06 StephenRoddy

sorry, but it doesn't for me.

Fructue avatar Jul 27 '22 19:07 Fructue

File "", line 1 conda install scipy=1.1.0 ^ SyntaxError: invalid syntax

that's what i got

Fructue avatar Jul 27 '22 19:07 Fructue