KeyError: 'n_workers' when trying to train
See original GitHub issueTried to run the train.py for ICNet using the README guide with Cityscapes dataset.
Windows 10
CUDA 10.1
GPU: Nvidia GEFORCE GTX 1050Ti
Using the Conda virtual environment. Issued the following command to train on the cityscapes
dataset:
python train.py --config configs\icnet_cityscapes.yml
The output from the PowerShell window
train.py:217: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
cfg = yaml.load(fp)
RUNDIR: runs\icnet_cityscapes\83671
Found 2975 train images
Found 500 val images
Traceback (most recent call last):
File "train.py", line 229, in <module>
train(cfg, writer, logger)
File "train.py", line 63, in train
num_workers=cfg["training"]["n_workers"],
KeyError: 'n_workers'
The config file
model:
arch: icnet
data:
dataset: cityscapes
train_split: train
val_split: val
img_rows: 512
img_cols: 1024
path: D:\Workspace\datasets\nn\cityscapes
training:
train_iters: 85000
batch_size: 2
val_interval: 500
print_interval: 25
optimizer:
lr: 1.0e-2
l_rate: 1.0e-2
l_schedule:
momentum: 0.99
weight_decay: 0.0005
resume: icnet_cityscapes_best_model.pkl
visdom: False
loss:
name: cross_entropy
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
KeyError occur when start training #958 - ultralytics/yolov5
Currently, I work on a face detection. I use the following command to train. python train.py --img 640 --batch 16 --epochs 5 --data...
Read more >KeyError 'metrics' when trying to train a model in tensorflow
I was working off some github code where I'm training a model to recognize laughter. This particular bit of code is giving me...
Read more >Train Deep Learning Model fails with KeyError: '0'
Solved: Hi all, I am trying to train and apply a Deep Learning model in ArcGis Pro 8.0 . I installed all the...
Read more >Only 5 out of 6 items are loaded to training dataset
I'm trying to load 6 different items to the training dataset, ... 430 431 KeyError: Caught KeyError in DataLoader worker process 0.
Read more >Getting KeyError: 'id' even when 'id' is present in the json file
Context: I am trying to train the VOC dataset on this few shot object detection library called FewX and in order to do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @keishatsai I solved it by specifying n_workers under the training section of the yaml file. Here is the sample config
Hope this helps!
does using cross_entropy as the loss while training icnet work for you ?