1

I want to change the default path of builtin PASCAL VOC Dataset in Detectron2.

According to the documentation,

You can set the location for builtin datasets by export DETECTRON2_DATASETS=/path/to/datasets

I'm unable to understand where to place the above statement.

Any help would be appreciated.

Thanks

MT0
  • 143,790
  • 11
  • 59
  • 117
  • 1
    It asks you to set an environment variable. Where are you running the Python script from (e.g. Bash)? – GoodDeeds Sep 20 '22 at 14:27
  • @GoodDeeds, I'm cloning Detectron2 in Kaggle and running the script over there as I want to utilize Kaggle's GPU. I do not have any knowledge of Bash etc. If you could point me to any relevant resources, it would also be really helpful. Thanks. – Yashika Jain Sep 20 '22 at 16:01
  • 1
    I am not really familiar how it is done in Kaggle. Threads such as [this](https://www.kaggle.com/code/alexandervc/path-trick-to-change-on-kaggle/notebook?scriptVersionId=71644458) suggest that using something like `os.environ["DETECTRON2_DATASETS"]="/path/to/datasets/"` at the top of your Python script may work (You will need to `import os` first). – GoodDeeds Sep 20 '22 at 17:44
  • @GoodDeeds, Thanks for the help, but running the above command gives "/bin/bash: python3: command not found" error. – Yashika Jain Sep 20 '22 at 18:17

1 Answers1

0

I met the same problem and the solution is simple following this.

First, in your terminal, import your customized dataset directory as env variable like this

My@Host:/MaskFormer-main$ export DETECTRON2_DATASETS="/public/COCO2017"

Then, running your scripts of the maskformer

My@Host:/MaskFormer-main$ python train_net.py --num-gpus 1  --config-file xxxxxxx
KingLiu
  • 59
  • 4