我正在尝试在 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) 我一直遵循本教程的要求,直到遇到错误为止
错误:找不到卡:PeerAdmin @ hlfv1
在下面的命令中:
composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network
Run Code Online (Sandbox Code Playgroud)
本教程说,通常必须创建一个peerAdmin身份,但他们已经创建了一个。