ConSERT icon indicating copy to clipboard operation
ConSERT copied to clipboard

Is it possible to run main.py in local machine without GPU?

Open Harry-hash opened this issue 4 years ago • 1 comments
trafficstars

As titled, thanks!

Harry-hash avatar Jun 11 '21 15:06 Harry-hash

Since the sentence-transformers library supports training with CPU only, our main.py can also run under the CPU-only setting.

To run without GPU, try:

  1. Prepare conda virtual environment and install the required libraries:
    conda create -n consert-cpuonly python=3.6  # create virtual environment
    conda install pytorch=1.6 cpuonly  # install pytorch-cpu
    pip install transformers==3.4.0 sentence-transformers==0.3.9 tensorboardX==2.1 pandas==1.1.5 sentencepiece==0.1.85 matplotlib  # install other dependencies
    
  2. Download the data and pre-trained language model (detailed in README.md)
  3. Run the script as in README.md, but without --use_apex_amp and --apex_amp_opt_level O1 arguments:
    python3 main.py --no_pair --seed 1 --batch_size 96 --max_seq_length 64 --evaluation_steps 200 --add_cl --cl_loss_only --cl_rate 0.15 --temperature 0.1 --learning_rate 0.0000005 --train_data stssick --num_epochs 10 --da_final_1 feature_cutoff --da_final_2 shuffle --cutoff_rate_final_1 0.2 --model_name_or_path ./bert-base-uncased/ --model_save_path ./output/unsup-base-feature_cutoff-shuffle --force_del --no_dropout --patience 10
    

yym6472 avatar Jun 12 '21 14:06 yym6472