jyh1 / bento-tool-instruction

0 stars 0 forks source link

For your information, these are the commands that work for me. #1

Open foxlf823 opened 4 years ago

foxlf823 commented 4 years ago
  1. build a docker image docker run --runtime nvidia -it --name feili_container -v $PWD:/opt/example pytorch/pytorch:1.0.1-cuda10.0-cudnn7-runtime bash

pip install pandas==0.24 pip install nltk==3.3 python -c 'import nltk; nltk.download("punkt", download_dir="/opt/conda/nltk_data")' python -c 'import nltk; nltk.download("averaged_perceptron_tagger", download_dir="/opt/conda/nltk_data")' pip install pytorch-pretrained-bert==0.6.1 pip install bioc==1.0 pip install future

  1. save the docker image

docker commit feili_container end2end_ner_norm_re docker tag end2end_ner_norm_re foxlf823/end2end_ner_norm_re:latest docker push foxlf823/end2end_ner_norm_re:latest

  1. upload code and run it in the codalab

cl upload end2end_ner_norm_re_092019

cl run --request-gpus 4 --request-memory 10g --request-docker-image foxlf823/end2end_ner_norm_re end2end_ner_norm_re_092019:0xca777c 'python end2end_ner_norm_re_092019/main.py -config end2end_ner_norm_re_092019/default.config -ner_re_model end2end_ner_norm_re_092019/pretrained_model -norm_model end2end_ner_norm_re_092019/pretrained_norm -input end2end_ner_norm_re_092019/input -predict predict1 -stopword end2end_ner_norm_re_092019/stopwords.txt -norm_dict end2end_ner_norm_re_092019/MRCONSO.RRF -gpu 0'

jyh1 commented 4 years ago

Thanks, looks nice! I have transformed it to a BENTO tool without any problem.

A few suggestions:

  1. I see 4 gpus are requested, are they all necessary in prediction? Using a lower resource requirement will help job scheduling.
  2. You could upload folders/files of different purpose as different bundles. This will make the 'cl run' command longer to write as you have to declare more dependencies, but it will be more convenient to use the command on different data or code. I reproduced your result with this approach here (fenway link, bionlp link). You can see there are multiple dependencies in the result bundle.