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

TypeError: Cannot handle this data type #113

Open
SlowMonk opened this issue Apr 30, 2020 · 1 comment
Open

TypeError: Cannot handle this data type #113

SlowMonk opened this issue Apr 30, 2020 · 1 comment

Comments

@SlowMonk
Copy link

print(target.shape,type(target))
(40, 40, 9) <class 'numpy.ndarray'>
m = Image.fromarray(target.astype('uint8'))


<ipython-input-31-b037b3c8b026> in make_dataset()
     26         print(target.shape,type(target))
     27         #rescaled = (255.0/feature.max() * (feature - feature.min())).astype(np.uint8)
---> 28         im = Image.fromarray(target.astype('uint8'))
     29         #im.save(train_path)
     30 

~/venv/lib/python3.7/site-packages/PIL/Image.py in fromarray(obj, mode)
   2645             mode, rawmode = _fromarray_typemap[typekey]
   2646         except KeyError:
-> 2647             raise TypeError("Cannot handle this data type")
   2648     else:
   2649         rawmode = mode

TypeError: Cannot handle this data type
@zer11
Copy link

zer11 commented Jul 6, 2020

Downgrading tensorboardX to 1.2 fixed this for me.
pip install --upgrade TensorBoardX==1.2

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

2 participants