Skip to content

Train with coco dataset, KeyError: 'coco' #3

@geekvc

Description

@geekvc

I trained and tested with the default alexnet net and voc2007 dataset, everything goes well.
I changed the options.lua with coco dataset, and netType with vgg19, some errors occured, maybe the dbcollection package caused the error.

$ th train.lua
==> (1/5) Load options
==> (2/5) Load dataset data loader
==> (3/5) Load roi proposals data
Processing COCO train RoI proposals...
 [======================================== 82783/82783 ================================>]  Tot: 14m37s | Step: 10ms
Save COCO train RoI proposals to cache: /home/wangty/geekvc/fastrcnn-example-torch/data/cache/coco_proposals_train.t7
Processing COCO val RoI proposals...
 [======================================== 40504/40504 ================================>]  Tot: 7m12s | Step: 10ms
Save COCO val RoI proposals to cache: /home/wangty/geekvc/fastrcnn-example-torch/data/cache/coco_proposals_val.t7
==> (4/5) Setup model:
==> (5/5) Train Fast-RCNN model

==> Download coco data to disk...
Traceback (most recent call last):
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 32, in fetch_dataset_constructor
    return datasets[name]
KeyError: 'coco'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/manager.py", line 69, in download
    keywords = dataset.download(name, data_dir_, cache_save_path, extract_data, verbose)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 124, in download
    dataset_loader = setup_dataset_constructor(name, data_dir, cache_dir, extract_data, verbose)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 69, in setup_dataset_constructor
    constructor = fetch_dataset_constructor(name)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 34, in fetch_dataset_constructor
    raise KeyError('Undefined dataset name: {}'.format(name))
KeyError: 'Undefined dataset name: coco'
/home/wangty/torch/install/bin/luajit: ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:60: attempt to index a nil value
stack traceback:
        ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:60: in function 'exists_task'
        ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:147: in function 'load'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:18: in function 'get_db_loader'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:164: in function 'fetch_loader_dataset'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:309: in function 'data_gen'
        /home/wangty/torch/install/share/lua/5.1/fastrcnn/train.lua:47: in function 'train'
        train.lua:66: in main chunk
        [C]: in function 'dofile'
        ...ngty/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00406620

I used this script in scripts/train_test_vgg16_coco.lua, and similar error occured.

$ th scripts/train_test_vgg16_coco.lua
Input options: -frcnn_hflip 0.5 -snapshot 10 -frcnn_rois_per_img 128 -nThreads 4 -optMethod sgd -netType vgg16 -trainIters 5000 -nGPU 1 -frcnn_test_max_size 1000 -frcnn_test_nms_thresh 0.3 -frcnn_test_scales 600 -frcnn_scales 600 -frcnn_roi_augment_offset 0.3 -frcnn_bg_thresh_lo 0.1 -frcnn_test_mode coco -dataset coco -frcnn_max_size 1000 -schedule {{40,1e-3,5e-4},{10,1e-4,5e-4}} -frcnn_imgs_per_batch 2 -frcnn_bg_thresh_hi 0.5 -expID frcnn_vgg16_coco -clear_buffers true -frcnn_fg_fraction 0.25 -frcnn_fg_thresh 0.5 -frcnn_bg_fraction 1 -testInter false
==> (1/5) Load options
==> (2/5) Load dataset data loader
==> (3/5) Load roi proposals data
==> (4/5) Setup model:
==> (5/5) Train Fast-RCNN model

==> Download coco data to disk...
Traceback (most recent call last):
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 32, in fetch_dataset_constructor
    return datasets[name]
KeyError: 'coco'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/manager.py", line 69, in download
    keywords = dataset.download(name, data_dir_, cache_save_path, extract_data, verbose)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 124, in download
    dataset_loader = setup_dataset_constructor(name, data_dir, cache_dir, extract_data, verbose)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 69, in setup_dataset_constructor
    constructor = fetch_dataset_constructor(name)
  File "/home/wangty/.pyenv/versions/anaconda3-4.1.0/lib/python3.5/site-packages/dbcollection/datasets/funs.py", line 34, in fetch_dataset_constructor
    raise KeyError('Undefined dataset name: {}'.format(name))
KeyError: 'Undefined dataset name: coco'
/home/wangty/torch/install/bin/luajit: ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:60: attempt to index a nil value
stack traceback:
        ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:60: in function 'exists_task'
        ...gty/torch/install/share/lua/5.1/dbcollection/manager.lua:147: in function 'load'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:18: in function 'get_db_loader'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:164: in function 'fetch_loader_dataset'
        /mnt/geekvc/fastrcnn-example-torch/data.lua:309: in function 'data_gen'
        /home/wangty/torch/install/share/lua/5.1/fastrcnn/train.lua:47: in function 'train'
        train.lua:66: in main chunk
        [C]: in function 'dofile'
        ...ngty/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00406620
==> (1/5) Load options
==> (2/5) Load dataset data loader
==> (3/5) Load roi proposals data
==> (4/5) Load model: /home/wangty/geekvc/fastrcnn-example-torch/data/exp/coco/vgg16_coco/model_final.t7
/home/wangty/torch/install/bin/luajit: cannot open </home/wangty/geekvc/fastrcnn-example-torch/data/exp/coco/vgg16_coco/model_final.t7> in mode r  at /home/wangty/torch/pkg/torch/lib/TH/THDiskFile.c:670
stack traceback:
        [C]: at 0x7fe6fb4ad330
        [C]: in function 'DiskFile'
        /home/wangty/torch/install/share/lua/5.1/torch/File.lua:405: in function 'load'
        test.lua:49: in main chunk
        [C]: in function 'dofile'
        ...ngty/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00406620

thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions