- 构建虚拟环境
- 进入R,安装reticulate包,该包建立R语言和python之间的关系。
- 出现各种bug
bug1:
Error: Installation of TensorFlow not found
解决方案:
进入/home/u19111010045/.local/share/r-miniconda/envs/r-reticulate的r-reticulate环境中,安装tensorflow
bug2:
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.1.0If you cannot immediately regenerate your protos, some other possible workarounds are:
- Downgrade the protobuf package to 3.20.x or lower.
- Set PROTOCOL_BUPFERS_PYTHON_iMPLEMENTATION=python (but this will use pure-Python parsing and will be mch slower ,More information:
https://developers.
google.com/protocol-buffers/docs/news/2022-05-06#python-updates
解决方案:
pip install protobuf==3.19.0
bug2:
tensorflow的Could not load dynamic library 'libcudart.so.10.1’错误
解决方案:
进入/home/u19111010045/.local/share/r-miniconda/envs/r-reticulate的r-reticulate环境中,安装cudatoolkit==10.1.243
同时将LD_LIBRARY_PATH的路径上增加libcudart.so.10.1所在库。