While executing the below code:
scipy.misc.toimage(output * 255, high=255, low=0, cmin=0, cmax=255).save(
params.result_dir + 'final/%5d_00_%d_out.png' % (test_id, ratio))
I get the below error:
AttributeError: module 'scipy.misc' has no attribute 'toimage'
I tried installing Pillow as mentioned here: scipy.misc module has no attribute imread? But the same error persisted. Please help. Thanks.
The
scipy.misc.toimage()
function was deprecated in Scipy 1.0.0, and was completely removed in version 1.3.0. From the 1.3.0 release notes:The notes link to the v1.1.0 documentation that shows what to use instead; from the
scipy.misc.toimage()
documentation for v1.1.0:The function does more work than just
Image.fromarray
could do, however. You could port the original function:This could be further simplified based on the actual arguments used; your sample code doesn't use the
pal
argument, for example.