跑代码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

相关推荐
一个人旅程~几秒前
双系统时windows如何读取linux ext4格式硬盘分区?
linux·windows·经验分享·电脑
齐齐大魔王4 分钟前
linux-进程详解
linux·运维·服务器
應呈9 分钟前
Bootloader与OTA学习记录
linux·运维·服务器
勤自省14 分钟前
在Ubuntu20.04上安装ROS
linux·ros
楼田莉子23 分钟前
同步/异步日志系统:工具类以及日志的简单模块
linux·服务器·数据结构·c++
corpse201028 分钟前
VirtualBox 安装ubuntu-25 ,配置SSH工具登录
linux·ubuntu·ssh
skywalk816331 分钟前
使用官方提供的 bump-pydantic 工具 来自动化部分迁移pydantic代码
运维·自动化
杜子不疼.33 分钟前
浏览器秒连服务器!WebSSH 实战体验,远程运维再也不折腾
运维·服务器·人工智能
她说彩礼65万33 分钟前
C语言 整形提升及算数转换
linux·服务器·c语言
loockluo34 分钟前
NFS网络存储部署与性能优化实战:家用服务器的学习与实践
服务器·网络·性能优化