我使用以下脚本自动升级我的库。
我的脚本(启动笔记本):
#!/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"
}