greydanus / mnist1d

A 1D analogue of the MNIST dataset for measuring spatial biases and answering Science of Deep Learning questions.
Apache License 2.0
190 stars 30 forks source link

Import mnist1d could not be resolved(reportMissingImports) in Colab #10

Closed zeeskore closed 4 months ago

zeeskore commented 4 months ago

This worked last week, but today when I try to import mnist1d in Colab after running !git clone https://github.com/greydanus/mnist1d I get no errors, but a yellow underline under import mnist1d that says:

Import "mnist1d" could not be resolved(reportMissingImports) in Colab

Then: args = mnist1d.data.get_dataset_args() fails with AttributeError: module 'mnist1d' has no attribute 'data'

greydanus commented 4 months ago

Shoot! I just made some changes to this repo's structure this week which are responsible for the problem you're reporting. See https://github.com/greydanus/mnist1d/pull/9

I'll try and add a fix so that what you're doing doesn't throw an error. In the meantime, I recommend looking at the notebooks linked in the README, as they use some workarounds to call get_dataset_args()

You could also clone this version, which is the version you were using last week before all these changes. It should work as expected.

zeeskore commented 4 months ago

Issue seems to be with mnist1d/mnist1d subfolder which was not there after git clone https://github.com/greydanus/mnist1d last week. Import mnist1d works after I move all the files in mnist1d/mnist1d back to the top mnist1d folder.

greydanus commented 4 months ago

Try pip install git+https://github.com/greydanus/mnist1d.git@master and then in Python: import mnist1d; mnist1d.get_dataset_args()