Skip to content

TypeError: Cannot handle this data type #113

@SlowMonk

Description

@SlowMonk
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions