-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'deep_classiflie_feat' into master
- Loading branch information
Showing
16 changed files
with
235 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM nvidia/cuda:10.2-base-ubuntu18.04 | ||
ARG USERNAME | ||
COPY . /tmp/build | ||
RUN ls /tmp/build | ||
VOLUME /experiments/${USERNAME} | ||
# Install some basic utilities and create non-root user | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
ca-certificates \ | ||
sudo \ | ||
git \ | ||
unzip \ | ||
bzip2 \ | ||
libx11-6 \ | ||
&& apt-get -y autoremove \ | ||
&& apt-get clean autoclean \ | ||
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /var/tmp/* \ | ||
&& adduser --disabled-password --gecos '' --shell /bin/bash ${USERNAME} \ | ||
&& chown "${USERNAME}":"${USERNAME}" /home/${USERNAME} /tmp/build -R \ | ||
&& chown "${USERNAME}":"${USERNAME}" /experiments/${USERNAME} -R \ | ||
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-${USERNAME} | ||
USER ${USERNAME} | ||
ENV HOME=/home/${USERNAME} | ||
ENV DC_BASE="${HOME}/repos/${USERNAME}" \ | ||
PYTHONPATH="${HOME}/repos/${USERNAME}:${HOME}/repos/captum:${HOME}/repos/transformers" \ | ||
CONDA_AUTO_UPDATE_CONDA=false \ | ||
TARGET_ENV=${USERNAME} | ||
RUN mkdir -p /home/${USERNAME}/repos /home/${USERNAME}/datasets/model_cache/${USERNAME} | ||
# Create a docker volume for the container | ||
WORKDIR /home/${USERNAME}/repos | ||
RUN git clone https://github.com/pytorch/captum.git \ | ||
&& git clone https://github.com/huggingface/transformers \ | ||
&& git clone https://github.com/speediedan/deep_classiflie.git | ||
RUN unzip /tmp/build/dc_ds.zip -d /home/${USERNAME}/datasets \ | ||
&& unzip /tmp/build/dc_model_alpha.zip -d /home/${USERNAME}/datasets/model_cache/${USERNAME} | ||
RUN curl -sLo ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh \ | ||
&& chmod +x ~/miniconda.sh \ | ||
&& ~/miniconda.sh -b -p ~/miniconda \ | ||
&& rm ~/miniconda.sh | ||
ENV PATH=$HOME/miniconda/bin:$PATH \ | ||
CONDA_DEFAULT_ENV=$TARGET_ENV | ||
RUN conda update -n base -c defaults conda | ||
RUN conda env create -f /tmp/build/deep_classiflie.yml -n ${USERNAME} \ | ||
&& conda clean -ya | ||
WORKDIR /home/${USERNAME}/repos/transformers | ||
RUN conda run -n ${TARGET_ENV} pip install . \ | ||
&& echo ". $HOME/miniconda/etc/profile.d/conda.sh" >> ~/.profile | ||
# Make RUN commands use the bash shell: | ||
SHELL ["/bin/bash", "-c"] | ||
RUN conda init bash \ | ||
&& rm -rf /tmp/build \ | ||
&& ls $HOME \ | ||
&& env | ||
WORKDIR $DC_BASE | ||
ENTRYPOINT conda run -n $TARGET_ENV python ./deep_classiflie.py |
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash --login | ||
set -e | ||
conda activate $TARGET_ENV | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
experiment: | ||
inference_ckpt: "/experiments/deep_classiflie/checkpoints/20201010172113/checkpoint-0.5595-29-148590.pt" | ||
predict_only: True | ||
debug: | ||
debug_enabled: False | ||
dirs: | ||
experiments_base_dir: "/experiments" # defaults to {base_dir}/experiments | ||
tmp_data_dir: "/home/deep_classiflie/datasets/dc_dataset_collection" # defaults to {raw_data_dir}/temp/{constants.APP_NAME} | ||
data_source: | ||
skip_db_refresh: True | ||
inference: | ||
interpret_preds: True | ||
purge_intermediate_rpt_files: True # default is True, left here for debugging convenience |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
experiment: | ||
db_functionality_enabled: False # must set to True to generate reports, run dctweetbot, among other functions | ||
inference_ckpt: "/experiments/deep_classiflie/checkpoints/20201010172113/checkpoint-0.5595-29-148590.pt" # note build_swa_from_ckpts will be ignored if inference_ckpt is present | ||
debug: | ||
debug_enabled: False | ||
dirs: | ||
experiments_base_dir: "/experiments" # defaults to {base_dir}/experiments | ||
tmp_data_dir: "/home/deep_classiflie/datasets/dc_dataset_collection" # defaults to {raw_data_dir}/temp/{constants.APP_NAME} | ||
data_source: | ||
# db_conf must be explictly specified only in dev mode or if db_conf is in a non-default location | ||
# db_conf: "/home/speediedan/repos/edification/deep_classiflie_db/deep_classiflie_db.yaml" | ||
skip_db_refresh: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
experiment: | ||
db_functionality_enabled: False | ||
debug: | ||
debug_enabled: True | ||
use_debug_dataset: False | ||
dirs: | ||
experiments_base_dir: "/experiments" # defaults to {base_dir}/experiments | ||
tmp_data_dir: "/home/deep_classiflie/datasets/dc_dataset_collection" # defaults to {raw_data_dir}/temp/{constants.APP_NAME} | ||
data_source: | ||
skip_db_refresh: True | ||
trainer: | ||
# restart_training_ckpt: "/experiments/deep_classiflie/checkpoints/20200826121309/checkpoint-0.6039-11-1236.pt" | ||
dump_model_thaw_sched_only: False | ||
label_smoothing_enabled: True | ||
# histogram_vars: ['classifier.weight', 'ctxt_embed.weight', 'albert.pooler.weight'] | ||
fine_tune_scheduler: | ||
thaw_schedule: "DeepClassiflie_thaw_schedule.yaml" | ||
earlystopping: | ||
patience: 4 | ||
monitor_metric: "val_loss" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters