小编the*_*ode的帖子

如何修复“在解释器中至少有 1 个以 numpy 数组或切片的形式引用内部数据”并在 tf.lite 上运行推理

我正在尝试在 mnist keras 模型上使用 tf.lite 运行推理,我通过根据进行训练后量化进行了优化

RuntimeError: There is at least 1 reference to internal data
in the interpreter in the form of a numpy array or slice. Be sure to
only hold the function returned from tensor() if you are using raw
data access.
Run Code Online (Sandbox Code Playgroud)

它发生在我将图像调整为 4 维或解释器本身(如注释行所示)之后;因为在此之前的错误类似于“预期 4 个维度,但发现 3 个”。这是代码:

import tensorflow as tf
tf.enable_eager_execution()
import numpy as np
from tensorflow.keras.datasets import mnist
import matplotlib.pyplot as plt
%matplotlib inline

mnist_train, mnist_test = tf.keras.datasets.mnist.load_data()
images, labels = …
Run Code Online (Sandbox Code Playgroud)

python-3.x tensorflow tensorflow-lite

11
推荐指数
1
解决办法
4128
查看次数

找不到作曲家运行时安装错误卡peerAdmin

我一直遵循教程的要求,直到遇到错误为止

错误:找不到卡:PeerAdmin @ hlfv1

在下面的命令中:

 composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network
Run Code Online (Sandbox Code Playgroud)

本教程说,通常必须创建一个peerAdmin身份,但他们已经创建了一个。

hyperledger hyperledger-fabric hyperledger-composer

2
推荐指数
1
解决办法
2762
查看次数