-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_env.sh
More file actions
26 lines (20 loc) · 910 Bytes
/
install_env.sh
File metadata and controls
26 lines (20 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#
# Installer for package
#
# Run: ./install_env.sh
#
echo 'Creating Package environment'
# create conda env
conda env create -f environment.yml
source ~/anaconda3/etc/profile.d/conda.sh 2>/dev/null || source ~/miniconda3/etc/profile.d/conda.sh
conda activate dmfco2
conda env list
echo 'Created and activated environment:' $(which python)
# Check pytorch works as expected
echo 'Checking torch version and running a command...'
python -c 'import torch; print(torch.__version__); print(torch.cuda.get_device_name(torch.cuda.current_device())); print(torch.ones(10).to("cuda:0"))'
# TODO convert below line to work for tensorflow test
# echo 'Checking tensorflow version and running a command...'
# python -c 'import tensorflow; print(tensorflow.__version__); print(tensorflow.cuda.get_device_name(tensorflow.cuda.current_device())); print(tensorflow.ones(10).to("cuda:0"))'
echo 'Done!'