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: Pretrain #37

Open
TheNoliOliandPea opened this issue Jun 6, 2024 · 4 comments
Open

KeyError: Pretrain #37

TheNoliOliandPea opened this issue Jun 6, 2024 · 4 comments

Comments

@TheNoliOliandPea
Copy link

Hello. I'm hoping I'm overlooking something obvious from this repo. I'm trying to run:

python train_chart.py --cfg_file CornerNetLine --data_dir "linedata(1028)"

But the error I'm receiving is:

(DeepRule) PS C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR> python train_chart.py --cfg_file CornerNetLine --data_dir "linedata(1028)"
{'system': {'snapshot_name': 'CornerNetLine', 'dataset': 'Line', 'batch_size': 26, 'sampling_function': 'kp_detection', 'train_split': 'trainchart', 'val_split': 'valchart', 'test_split': 'testchart', 'learning_rate': 0.00025, 'decay_rate': 10, 'val_iter': 100, 'opt_algo': 'adam', 'prefetch_size': 5, 'max_iter': 50000, 'stepsize': 45000, 'snapshot': 5000, 'chunk_sizes': [5, 7, 7, 7], 'data_dir': '$AZUREML_DATAREFERENCE_workspaceblobstore/chartdata(0610)/', 'cache_dir': './cache_pure/', 'display': 5}, 'db': {'rand_scale_min': 0.6, 'rand_scale_max': 1.4, 'rand_scale_step': 0.1, 'rand_scales': None, 'rand_crop': True, 'rand_color': True, 'border': 128, 'gaussian_bump': True, 'gaussian_iou': 0.3, 'input_size': [511, 511], 'output_sizes': [[128, 128]], 'test_scales': [1], 'top_k': 200, 'categories': 1, 'ae_threshold': 0.5, 'nms_threshold': 0.5, 'max_per_image': 100, 'annotations': 'line/annotations/instancesLine(1023)_train2019.json'}}
['cache', 'line']
loading all datasets...
using 1 threads
loading from cache file: linedata(1028)\cache\line_train2019.pkl
loading annotations into memory...
Path to file: C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR\linedata(1028)\line\annotations\instancesLine(1023)_train2019.json
Done (t=3.71s)
creating index...
index created!
loading from cache file: linedata(1028)\cache\line_val2019.pkl
loading annotations into memory...
Path to file: C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR\linedata(1028)\line\annotations\instancesLine(1023)_val2019.json
Done (t=0.12s)
creating index...
index created!
system config...
{'batch_size': 26,
'cache_dir': 'linedata(1028)\cache',
'chunk_sizes': [5, 7, 7, 7],
'config_dir': 'config',
'data_dir': 'linedata(1028)',
'data_rng': RandomState(MT19937) at 0x11108D6D140,
'dataset': 'Line',
'decay_rate': 10,
'display': 5,
'learning_rate': 0.00025,
'max_iter': 50000,
'nnet_rng': RandomState(MT19937) at 0x11108D6D240,
'opt_algo': 'adam',
'prefetch_size': 5,
'result_dir': 'results',
'sampling_function': 'kp_detection',
'snapshot': 5000,
'snapshot_name': 'CornerNetLine',
'stepsize': 45000,
'tar_data_dir': 'cls',
'test_split': 'testchart',
'train_split': 'trainchart',
'val_iter': 100,
'val_split': 'valchart'}
db config...
{'ae_threshold': 0.5,
'border': 128,
'categories': 1,
'data_aug': True,
'gaussian_bump': True,
'gaussian_iou': 0.3,
'gaussian_radius': -1,
'input_size': [511, 511],
'lighting': True,
'max_per_image': 100,
'merge_bbox': False,
'nms_algorithm': 'exp_soft_nms',
'nms_kernel': 3,
'nms_threshold': 0.5,
'output_sizes': [[128, 128]],
'rand_color': True,
'rand_crop': True,
'rand_pushes': False,
'rand_samples': False,
'rand_scale_max': 1.4,
'rand_scale_min': 0.6,
'rand_scale_step': 0.1,
'rand_scales': array([0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3]),
'special_crop': False,
'test_scales': [1],
'top_k': 200,
'weight_exp': 8}
len of db: 116745
Traceback (most recent call last):
File "C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR\train_chart.py", line 206, in
train(training_dbs, validation_db, args.start_iter)
File "C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR\train_chart.py", line 76, in train
pretrained_model = system_configs.pretrain
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\lemon\OneDrive\Documents\GitHub\ChartOCR\config.py", line 99, in pretrain
return self._configs["pretrain"]
~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'pretrain'

My inkling is that it's not loading a pretrained model in config, however if that's the case, I have no idea which file is the pretrained file in this repo. Or when I go to comment it out to run without the pretrained parameters, it'll give me the same error as well. I'm a bit new to all of this so any help is much appreciate it.

@soap117
Copy link
Owner

soap117 commented Jun 9, 2024

See the dataset link, included.

@TheNoliOliandPea
Copy link
Author

See the dataset link, included.

So I have that included in the directory. It's loading the line(1028) (or whatever the actual folder name is). Then to clarify, it's the one under chart pipeline model that I'm probably not loading correctly perhaps? Thanks.

@soap117
Copy link
Owner

soap117 commented Jun 9, 2024 via email

@TheNoliOliandPea
Copy link
Author

TheNoliOliandPea commented Jun 10, 2024

I see! I'll check there, thank you for pointing that out.

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