SELD_net_questions

SELD-net实验问题梳理

源代码调试时遇到的错误及解决

seld-net原版代码:https://gitee.com/karas1/seld-net

拿到源代码后,按照readme.md文件中的提示尝试运行,发现出现了很多问题,这里总结了一下解决方案。

1、整型变量问题

运行的时候提示DataType数据类型不匹配,原因是调用含整数参数的方法时,没有声明赋给的参数时整数值。

SELD_net_questions
SELD_net_questions

; 解决:

根据错误提示信息,定位到代码对应行,观测一下方法中各个参数格式,把需要是int型的变量用int()强转一下。

SELD_net_questions

2、运行环境中Tensorflow版本问题

E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:697] Iteration = 0, topological sort failed with message: The graph couldn’t be sorted in topological order.

E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] remapper failed: Invalid argument: The graph couldn’t be sorted in topological order.

E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] arithmetic_optimizer failed: Invalid argument: The graph couldn’t be sorted in topological order.

SELD_net_questions

; 解决:

为了可以在带有显卡gpu的机器上跑,提高运行效率,可以把

原版本tensorflow1.10.0 + keras2.0.8

改为:tensorflow_gpu1.14.0 + keras2.2.5

pip list
pip uninstall tensorflow==1.10.0
pip uninstall keras==2.0.8
pip install tensorflow==1.14.0
pip install keras==2.2.5

3、找不到sklearn==0.19.0安装包,使用更高版本的sklearn找不到joblib库

SELD_net_questions

; 解决:

安装的时候使用以下命令,不要使用缩写sklearn:

pip install -U scikit-learn==0.19.0

SELD_net_questions

4、batch_size(批处理大小)太大,导致系统资源不够分配

SELD_net_questions

Resource exhausted: OOM when allocating tensor with shape[16,256,64,512] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
​ [[{{node batch_normalization_1/FusedBatchNorm}}]]

; 解决:把batch_size批处理大小调小一些

1)可以改超参数(不推荐):

SELD_net_questions
2)也可以在Parameter.py里面写一个条件语句,然后运行时使用参数9来运行
SELD_net_questions

5、不定时出现,尚未解决。应该是带参运行时参数格式有错误。

SELD_net_questions

; 解决:

可以切换到控制台命令行Terminal模式中,使用如下格式的命令运行:

python seld.py 1 999

Original: https://blog.csdn.net/qq_42074210/article/details/121243535
Author: Dijkstra’s Monk-ey
Title: SELD_net_questions

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/514172/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球