使用 AWS Sagemaker Notebook 的生命周期配置升级 ML 库时出现问题
Issues in upgrading ML libraries using AWS Sagemaker Notebook's Lifecycle configurations
我使用以下脚本自动升级我的库。
我的脚本(启动笔记本):
#!/bin/bash
set -e
echo 'Before:'
echo $PATH
export PATH=/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin:/home/ec2-user/anaconda3/bin/:/usr/libexec/gcc/x86_64-amazon-linux/4.8.5:/usr/local/cuda/bin:/usr/local/bin:/opt/aws/bin:/usr/local/mpi/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:$PATH
echo 'After:'
echo $PATH
echo `pwd`
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36
pip install pandas --upgrade
pip install tensorflow-gpu --upgrade
错误:
我收到以下错误,如何指向keras的正确位置(/home/ec2-user)而不是/root
cp: cannot stat ‘/root/.keras/keras_tensorflow.json’: No such file or directory
完整日志:
Before:
/sbin:/bin:/usr/sbin:/usr/bin
After:
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin:/home/ec2-user/anaconda3/bin/:/usr/libexec/gcc/x86_64-amazon-linux/4.8.5:/usr/local/cuda/bin:/usr/local/bin:/opt/aws/bin:/usr/local/mpi/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/sbin:/bin:/usr/sbin:/usr/bin
/home/ec2-user
cp: cannot stat ‘/root/.keras/keras_tensorflow.json’: No such file or directory
没有生命周期配置:
以上脚本中的所有命令都有效。
当我删除具有以下值的生命周期配置时,实际 keras.json 文件正在 /home/ec2-user 下。
sh-4.2$ cat .keras/keras.json
{
"backend": "tensorflow"
}
看起来 pip install
在你的案例中执行了 virtualenv "outside"
尝试更改自:
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36
至:
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36 && pip install pandas tensorflow-gpu --upgrade
并删除多余的行
我使用以下脚本自动升级我的库。
我的脚本(启动笔记本):
#!/bin/bash
set -e
echo 'Before:'
echo $PATH
export PATH=/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin:/home/ec2-user/anaconda3/bin/:/usr/libexec/gcc/x86_64-amazon-linux/4.8.5:/usr/local/cuda/bin:/usr/local/bin:/opt/aws/bin:/usr/local/mpi/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:$PATH
echo 'After:'
echo $PATH
echo `pwd`
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36
pip install pandas --upgrade
pip install tensorflow-gpu --upgrade
错误:
我收到以下错误,如何指向keras的正确位置(/home/ec2-user)而不是/root
cp: cannot stat ‘/root/.keras/keras_tensorflow.json’: No such file or directory
完整日志:
Before:
/sbin:/bin:/usr/sbin:/usr/bin
After:
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin:/home/ec2-user/anaconda3/bin/:/usr/libexec/gcc/x86_64-amazon-linux/4.8.5:/usr/local/cuda/bin:/usr/local/bin:/opt/aws/bin:/usr/local/mpi/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/sbin:/bin:/usr/sbin:/usr/bin
/home/ec2-user
cp: cannot stat ‘/root/.keras/keras_tensorflow.json’: No such file or directory
没有生命周期配置:
以上脚本中的所有命令都有效。
当我删除具有以下值的生命周期配置时,实际 keras.json 文件正在 /home/ec2-user 下。
sh-4.2$ cat .keras/keras.json
{
"backend": "tensorflow"
}
看起来 pip install
在你的案例中执行了 virtualenv "outside"
尝试更改自:
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36
至:
source /home/ec2-user/anaconda3/bin/activate tensorflow_p36 && pip install pandas tensorflow-gpu --upgrade
并删除多余的行