小编use*_*600的帖子

Python tensorflow lite错误?无法设置张量:获得类型1的张量但预期输入88的类型3

我目前在想如何提取张量流精简版并测试我的数据集。但我觉得我遇到了一些python编译错误: 在此处输入图片说明

这是我的代码:

interpreter = tf.contrib.lite.Interpreter(model_path=
    "/mnt/ficusspain/cqli/tensorflow_models/Quantized_Models/mobilenet_v1_0.25_128_quant/mobilenet_v1_0.25_128_quant.tflite")
interpreter.allocate_tensors()

print("can we get here?")

# Get input and output tensors.
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

print("can we get here")

# Test model on random input data.
input_shape = input_details[0]['shape']
print(input_shape)
print(input_details[0]['index'])
print(output_details[0]['index'])


input_data = np.array(np.random.random_sample(input_shape), dtype=np.float32)
interpreter.set_tensor(input_details[0]['index'], input_data)

interpreter.invoke()
output_data = interpreter.get_tensor(output_details[0]['index'])
print(output_data)
Run Code Online (Sandbox Code Playgroud)

python tensorflow tensorflow-lite

6
推荐指数
1
解决办法
2919
查看次数

为什么我在使用docker机器时需要密码才能访问jupyter笔记本?

当我使用docker机器打开我的Jupyter笔记本时,会发生一个奇怪的问题.该网站需要我输入密码,以便我可以访问笔记本.真奇怪!你知道为什么吗?实际上,我正在使用我的docker机器来使用tensorflow来学习机器学习.我使用docker容器和终端来获取tensorflow并尝试在浏览器上打开jupyter notebook.但它允许我在Jupyter出现在我的浏览器后输入密码以使用笔记本.

docker tensorflow jupyter-notebook

5
推荐指数
1
解决办法
1185
查看次数

如何在Python中的Moviepy中使用fl_image函数?

我想使用不同的名称将视频保存到另一个文件中.因此,我有以下代码来处理这个问题:

def process_image_1(image):
  img=mpimg.imread(image)
  return img;
Run Code Online (Sandbox Code Playgroud)

还有,我有

output='output.mp4'
clip1 = VideoFileClip("Right.mp4")
clip = clip1.fl_image(process_image_1)
%time clip.write_videofile(output, audio=False)
Run Code Online (Sandbox Code Playgroud)

但是,我收到以下错误:

Object does not appear to be a 8-bit string path or a Python file-like object
Run Code Online (Sandbox Code Playgroud)

我不确定它有什么问题,有人可以告诉我为什么吗?

python image-processing movieclip python-3.x moviepy

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

bigram和unigram文本特征提取有什么区别

我在网上搜索过提取二元语法和单字语法文本特征,但仍然找不到有用的信息,有人可以告诉我它们之间有什么区别吗?

例如,如果我有一条文字“我有一只可爱的狗”,那么如果我使用二元语法方法进行特征提取和二元语法提取,将会发生什么?

nlp machine-learning

0
推荐指数
2
解决办法
4969
查看次数