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

KeyError: 'class_name' #33

Open
zcjgl opened this issue Sep 4, 2020 · 4 comments
Open

KeyError: 'class_name' #33

zcjgl opened this issue Sep 4, 2020 · 4 comments

Comments

@zcjgl
Copy link

zcjgl commented Sep 4, 2020

when i train the model ,it occurd KeyError: 'class_name'
Traceback (most recent call last):
File "/home/cc/anaconda3/envs/HowToTrainYourMAMLPytorch-master/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2889, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 97, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'class_name'
please tell me methods of resolution,thank you very much

@ceevaaa
Copy link

ceevaaa commented Nov 15, 2020

Make sure you successfully ran the two datasets preparing files ( prepare_mini_imagenet.py and prepare_omniglot.py ) in the Scripts folder. Even if you plan to use only one dataset you need to prepare both of them. This is because the datasets.py file in the few-shot folder contains both the classes omniglot and miniimagenet.

I hope this works.

@marzi-heidari
Copy link

marzi-heidari commented Nov 29, 2021

I had the same problem. Apparently, in my case DATA_PATH in config.py was wrong and prepare_omniglot.py couldn't process data. (There was no exception but data wasn't present in the folders). In my case, there was no need to run prepare_mini_imagenet.py

@MasterWinston
Copy link

I encountered the same error, and the reason for my error is that I moved the two scripts for processing data to the project directory to run.

My solution : ensure that these two scripts ('prepare_mini_imagenet. py' and 'prepare_omniglot. py') are run in the scripts directory. For example, in 'config. py', you set DATA_ PATH='../data', you need to create a new data folder under the project directory, put the dataset in the data folder as required, and then run two scripts under the scripts directory respectively. After successfully processing the data, this problem should not occur again when you train the model.

@Xiaohan-Chen
Copy link

Hi, I encountered the same problem. It's because the data were not placed in the correct directory. As mentioned in README.md file, put the 'images_background' and 'images_evaluation' files into 'DATA_PATH/Omniglot/', and the problem could be resolved.

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

5 participants