跑代码KGAT遇到的错误的解决过程记录

1.pip install -U protobuf

conda install scikit-learn

2. jupyterLab生成一个新的kernel:

conda create -n kgat5 python=3.7.2 ipykernel

python -m ipykernel install --name kgat5 --display-name kgat5 --user

3.pip install tensorflow-gpu=1.12.0

安装后import tensorflow as tf报错,按照如下修改后,还是报错

(196条消息) ImportError: libcublas.so.9.0: cannot open shared object file: No such file...问题原因及解决方法_lzw李正文的博客-CSDN博客

于是,提升了tf的版本号,还是1.x:

pip install tensorflow-gpu=1.15.0

pip install tensorflow_gpu-1.15.0-cp37-cp37m-manylinux2010_x86_64.whl

4.报错:

TypeError: Descriptors cannot not be created directly.

If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.

If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.

  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

解决方案:

pip install protobuf==3.20.*

5.CPU训练:

gpu-id=-1

6.报错:

2023-08-01 10:22:25.625741: F tensorflow/stream_executor/lib/statusor.cc:34] Attempting to fetch value instead of handling error Internal: no supported devices found for platform CUDA

Aborted (core dumped)

解决方案:

查看gpu使用情况: nvidia-smi

修改默认gpu-id=1

相关推荐
口袋物联19 分钟前
设计模式之工厂模式在 C 语言中的应用(含 Linux 内核实例)
linux·c语言·设计模式·简单工厂模式
qq_479875431 小时前
X-Macros(1)
linux·服务器·windows
笨笨聊运维2 小时前
CentOS官方不维护版本,配置python升级方法,无损版
linux·python·centos
ζั͡山 ั͡有扶苏 ั͡✾2 小时前
EFK 日志系统搭建完整教程
运维·jenkins·kibana·es·filebeat
jun_bai3 小时前
python写的文件备份网盘程序
运维·服务器·网络
Warren983 小时前
Python自动化测试全栈面试
服务器·网络·数据库·mysql·ubuntu·面试·职场和发展
HIT_Weston3 小时前
39、【Ubuntu】【远程开发】拉出内网 Web 服务:构建静态网页(二)
linux·前端·ubuntu
欢喜躲在眉梢里4 小时前
CANN 异构计算架构实操指南:从环境部署到 AI 任务加速全流程
运维·服务器·人工智能·ai·架构·计算
weixin_537765804 小时前
【容器技术】虚拟化原理与Docker详解
运维·docker·容器
胡斌附体4 小时前
docker健康检查使用
运维·docker·依赖·健康检查