Toybrick

楼主: jax.fang

人工智能开发系列(8) 表情识别

小宁哥

注册会员

积分
93
发表于 2019-12-9 11:07:27 | 显示全部楼层
小宁哥 发表于 2019-12-9 10:46
在image_demo里load_image 报错,invalid interpolation method,我改为opencv 读图后,结果图为空,是怎么 ...

后面两张图 可以正确识别
回复

使用道具 举报

liuwenhua

中级会员

积分
378
发表于 2019-12-12 10:21:43 | 显示全部楼层
小宁哥 发表于 2019-12-9 10:46
在image_demo里load_image 报错,invalid interpolation method,我改为opencv 读图后,结果图为空,是怎么 ...

降低OpenCV版本试试
回复

使用道具 举报

wzp

注册会员

积分
63
发表于 2020-4-20 20:11:28 | 显示全部楼层
小白初次接触TB-RK3399Pro开发板,运行上边的表情识别案例时遇到以下问题:
1、运行python3 rknn_image_demo.py test_images/1.jpg  时,出现以下提示:
File “rknn_image_demo.py”, line 59, in <module>
image_path = sys.argv[1]
IndexError: list index out of range

2、开发板运行python3 rknn_video_demo.py 可以在正常跑通,但是在电脑虚拟机的Ubuntu上ssh远程开发板运行python3 rknn_video_demo.py 出现以下提示:
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
求大神解答。
回复

使用道具 举报

NIELSONGOD

中级会员

积分
246
发表于 2020-5-27 14:40:55 | 显示全部楼层
小宁哥 发表于 2019-12-9 10:46
在image_demo里load_image 报错,invalid interpolation method,我改为opencv 读图后,结果图为空,是怎么 ...

同样的问题,请问你解决了么?求指导
回复

使用道具 举报

jax.fang

中级会员

积分
366
 楼主| 发表于 2020-6-1 16:15:02 | 显示全部楼层
wzp 发表于 2020-4-20 20:11
小白初次接触TB-RK3399Pro开发板,运行上边的表情识别案例时遇到以下问题:
1、运行python3 rknn_image_dem ...

1. rknn_image_demo.py 后面需要加一个图片路径的参数
2. SSH远程运行需安装支持Xserver的客户端软件
回复

使用道具 举报

jax.fang

中级会员

积分
366
 楼主| 发表于 2020-6-1 16:37:46 | 显示全部楼层
NIELSONGOD 发表于 2020-5-27 14:40
同样的问题,请问你解决了么?求指导

可能是keras的版本不对导致无效接口定义, 可试试降低TensorFlow的版本?
回复

使用道具 举报

李雪梅

注册会员

积分
170
发表于 2020-11-3 17:20:10 | 显示全部楼层
tensorflow版本是1.11.0版本,执行python3 rknn_transfer.py后总是提醒:ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental',怎么解决?系统提醒安装tensorflow2.2版本的,但安装不了,怎么解决?
回复

使用道具 举报

ccb1129086912

注册会员

积分
129
发表于 2020-11-16 10:03:46 | 显示全部楼层
李雪梅 发表于 2020-11-3 17:20
tensorflow版本是1.11.0版本,执行python3 rknn_transfer.py后总是提醒:ModuleNotFoundError: No module n ...

我也是,请问你解决了吗
回复

使用道具 举报

qingtian123

新手上路

积分
30
发表于 2022-6-13 16:22:34 | 显示全部楼层
运行python3 rknn_transfer.py报错如下( python3==3.6.9 , tensorflow==1.14.0, keras==2.2.5), 帮忙看下什么原因

W:tensorflow:From /home/xx/workspace/venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

Traceback (most recent call last):
  File "rknn_transfer.py", line 124, in <module>
    pb_transfer()
  File "rknn_transfer.py", line 55, in pb_transfer
    net_model = load_model(weight_file_path)
  File "/home/xx/workspace/venv/lib/python3.6/site-packages/keras/engine/saving.py", line 458, in load_wrapper
    return load_function(*args, **kwargs)
  File "/home/xx/workspace/venv/lib/python3.6/site-packages/keras/engine/saving.py", line 550, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "/home/xx/workspace/venv/lib/python3.6/site-packages/keras/engine/saving.py", line 242, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
回复

使用道具 举报

ziyifly

新手上路

积分
27
发表于 2022-10-20 20:44:45 | 显示全部楼层
你好,请问TensorFlow的版本和keras的版本分别应该多少呢? 既然是官方推荐的帖子,希望能描述详细一些帮到我们
我现在用的是官方1.4.0的docker,rknn-toolkit2-1.40,TensorFlow和Keras 两个版本都是 2.6.2 ,但转换模型时提示:

  1. root@2c548c52c948:/rknn_test# python3 rknn_transfer.py
  2. 2022-10-20 20:42:44.727550: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
  3. 2022-10-20 20:42:44.727594: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
  4. /usr/local/lib/python3.8/dist-packages/keras/backend.py:401: UserWarning: `tf.keras.backend.set_learning_phase` is deprecated and will be removed after 2020-10-11. To update it, simply pass a True/False value to the `training` argument of the `__call__` method of your layer or model.
  5.   warnings.warn('`tf.keras.backend.set_learning_phase` is deprecated and '
  6. 2022-10-20 20:42:45.534988: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
  7. 2022-10-20 20:42:45.535040: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
  8. 2022-10-20 20:42:45.535060: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (2c548c52c948): /proc/driver/nvidia/version does not exist
  9. 2022-10-20 20:42:45.535192: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
  10. To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
  11. W:tensorflow:Error in loading the saved optimizer state. As a result, your model is starting with a freshly initialized optimizer.
  12. input is : input_1
  13. output is: predictions/Softmax:0
  14. Traceback (most recent call last):
  15.   File "rknn_transfer.py", line 124, in <module>
  16.     pb_transfer()
  17.   File "rknn_transfer.py", line 62, in pb_transfer
  18.     frozen_graph = freeze_session(K.get_session(), output_names=[net_model.output.op.name])
  19.   File "/usr/local/lib/python3.8/dist-packages/keras/engine/keras_tensor.py", line 222, in op
  20.     raise TypeError('Keras symbolic inputs/outputs do not '
  21. TypeError: Keras symbolic inputs/outputs do not implement `op`. You may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.
  22. root@2c548c52c948:/rknn_test#
复制代码

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表