Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: cannot select an axis to squeeze out which has size not equal to one #1

Open
zensife opened this issue Feb 20, 2020 · 0 comments

Comments

@zensife
Copy link

zensife commented Feb 20, 2020

Hello,

I'm using numpy==1.18.1, matplotlib==3.1.3, Pillow==7.0.0 within python3.6.2 environment.

Reproducing code example:

python srgan.py -p .\timg.jpg

I get the following error:

Error message:

AttributeError                            Traceback (most recent call last)
c:\users\shinf\appdata\local\programs\python\python36\lib\site-packages\numpy\core\fromnumeric.py in squeeze(a, axis)
   1476     try:
-> 1477         squeeze = a.squeeze
   1478     except AttributeError:

AttributeError: 'list' object has no attribute 'squeeze'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-26-08dba2faa8e2> in <module>
----> 1 fake_img_batch = np.squeeze(fake_img_batch,axis=1)

<__array_function__ internals> in squeeze(*args, **kwargs)

c:\users\shinf\appdata\local\programs\python\python36\lib\site-packages\numpy\core\fromnumeric.py in squeeze(a, axis)
   1477         squeeze = a.squeeze
   1478     except AttributeError:
-> 1479         return _wrapit(a, 'squeeze', axis=axis)
   1480     if axis is None:
   1481         return squeeze()

c:\users\shinf\appdata\local\programs\python\python36\lib\site-packages\numpy\core\fromnumeric.py in _wrapit(obj, method, *args, **kwds)
     45     except AttributeError:
     46         wrap = None
---> 47     result = getattr(asarray(obj), method)(*args, **kwds)
     48     if wrap:
     49         if not isinstance(result, mu.ndarray):

ValueError: cannot select an axis to squeeze out which has size not equal to one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant