Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

Image dimension for ploting #2

Open
dcharua opened this issue Mar 21, 2018 · 3 comments
Open

Image dimension for ploting #2

dcharua opened this issue Mar 21, 2018 · 3 comments

Comments

@dcharua
Copy link

dcharua commented Mar 21, 2018

Hello, first let me congratulate for an excellent code. It's well documented and well written. All the other plots that are tried were not good enough to understand the data, this one is very clear.
Anyway to the point. I tried it with my own dataset, I'm able to plot in 3d and 2d, as well as to do the embedding, but I cannt overlay the images, I get the following error

Traceback (most recent call last):
File "main.py", line 134, in
main(config)
File "main.py", line 115, in main
im = OffsetImage(X_sample[i], zoom=0.1, cmap='gray')
File "/usr/local/lib/python3.5/dist-packages/matplotlib/offsetbox.py", line 1300, in init
self.set_data(arr)
File "/usr/local/lib/python3.5/dist-packages/matplotlib/offsetbox.py", line 1304, in set_data
self.image.set_data(self._data)
File "/usr/local/lib/python3.5/dist-packages/matplotlib/image.py", line 653, in set_data
raise TypeError("Invalid dimensions for image data")
TypeError: Invalid dimensions for image data

My X_sample is of shape (5000, 3, 32, 32)
where 5000 is the data size
X_sample[i].shape is (3, 32, 32)

What is the correct dimension?

Thank you for your time and code

@simplystart-from-begining

I'm lucky to be able to focus on your work,l'm trying this code with my own datasets,but i'm not able to plot in 2d and 3d,i get error ''KeyError: 'train_imgs''
what's the correct code and command?thanks in advance

@dcharua
Copy link
Author

dcharua commented Mar 13, 2019

Not sure what the question is, but I worked on this project a few months ago, you can see my code adaptation in this repo

@simplystart-from-begining

thanks a lot to your reply.i have reviewed your code adaptation,what about your 'data4torch.h5' file?I hope get your help,thanks in advance.
[email protected]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants