tensorflow

What if Batch Normalization is used in training mode when testing?

时光毁灭记忆、已成空白 提交于 2021-01-26 18:35:36
问题 Batch Normalization has different behavior in training phase and testing phase. For example, when using tf.contrib.layers.batch_norm in tensorflow, we should set different value for is_training in different phase. My qusetion is: what if I still set is_training=True when testing? That is to say what if I still use the training mode in testing phase? The reason why I come up with this question is that, the released code of both Pix2Pix and DualGAN don't set is_training=False when testing. And

Convert python sequence with multiple datatypes to tensor

笑着哭i 提交于 2021-01-26 18:02:10
问题 I'm using TensorFlow r1.7 and python3.6.5. I am also very new to TensorFlow, so I'd like easy to read explanations if possible. I'm trying to convert my input data into a dataset of tensors with this function tf.data.Dataset.from_tensor_slices() . I pass my tuple with mixed datatypes into this function. However, when running my code I get this error: ValueError: Can't convert Python sequence with mixed types to Tensor . I want to know why I am receiving this error, and how I can convert my

Convert python sequence with multiple datatypes to tensor

北城以北 提交于 2021-01-26 18:00:21
问题 I'm using TensorFlow r1.7 and python3.6.5. I am also very new to TensorFlow, so I'd like easy to read explanations if possible. I'm trying to convert my input data into a dataset of tensors with this function tf.data.Dataset.from_tensor_slices() . I pass my tuple with mixed datatypes into this function. However, when running my code I get this error: ValueError: Can't convert Python sequence with mixed types to Tensor . I want to know why I am receiving this error, and how I can convert my

RuntimeError: as_numpy_iterator() is not supported while tracing functions

风流意气都作罢 提交于 2021-01-26 17:31:14
问题 while i was using function as_numpy_iterator() got error --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) in () ----> 1 image = get_image_data(image_paths) 1 frames /tensorflow-2.1.0/python3.6/tensorflow_core/python/data/ops/dataset_ops.py in as_numpy_iterator(self) 488 """ 489 if not context.executing_eagerly(): --> 490 raise RuntimeError("as_numpy_iterator() is not supported while tracing " 491 "functions") 492 for

Numpy版本问题,import tensorflow as tf 报警:“ FutureWarning: Passing (type, 1) or '1type' as a s...

谁说胖子不能爱 提交于 2021-01-26 11:11:56
tensorflow cpu版,成功安装后 import tensorflow as tf 报警:“ FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'” 可能原因:numpy 的版本过低或者过高都会出现警告 解决:先卸载现有的numpy版本,并重新指定安装1.16.4(我的anaconda最新版本)版本的numpy pip uninstall numpy pip install numpy==1.16.4 默认镜像出现下载安装错误 于是更换镜像源再安装 pip install numpy==1.16.4 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 输入测试后不再报错 原文出处:https://www.cnblogs.com/dawankuanmian/p/11510237.html 来源: oschina 链接: https://my.oschina.net/u/4267381/blog/3253309

Python3 import tensorflow 出现FutureWarning: Passing (type, 1) or '1type' 问题

做~自己de王妃 提交于 2021-01-26 11:11:40
解决python调用TensorFlow时出现FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate 2019-08-13 19:51:37 涵小呆 阅读数 15679 更多 分类专栏: tensorflow 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接: https://blog.csdn.net/BigDream123/article/details/99467316 最近因为要做一个基于深度学习的人脸识别项目,要用到TensorFlow,但是下载完成后后发现import tensorflow总是出现FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'._np_quint8 = np.dtype([("quint8", np.uint8, 1)])的错误,如图 百度了许多,很多说是numpy的版本不对,换了numpy的版本就行了

报错FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of type is deprecated; in a future ver...

杀马特。学长 韩版系。学妹 提交于 2021-01-26 10:23:20
PyCharm应用conda自己创建的虚拟环境里面的tensorflow1.3.0版本报错; C:\ProgramData\Anaconda3\envs\python36tfgpu\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’. _np_qint8 = np.dtype([(“qint8”, np.int8, 1)]) … 报错原因是Numpy版本过高为1.19; 因此,安装低版本的Numpy就不会报错,安装过程自动卸载高版本; 首先,进入自己创建的虚拟环境 >activate xxx(环境名字) 然后,安装指令为 >pip install numpy==1.16.4 执行即可。 来源: oschina 链接: https://my.oschina.net/u/4377703/blog/4924894

Python-GUI|Tkinter模块

谁说我不能喝 提交于 2021-01-26 08:19:14
01 Tkinter Tkinter模块是 Python 的标准Tk GUI工具包的接口,它并不是必须掌握的,但是 掌握一个Python的标准图形库还是非常有意思的一件事 。 它可以跨平台运行在 Windows,Linux和Mac等系统上。 这篇文章不会介绍如何灵活地运用Tkinter,而是阐述Tkinter这个库包括什么,它能干什么! 02 第一个Tk-GUI from tkinter import * root=Tk() root.title('first tk gui') root.geometry('500x200') x = Label(root,text='Hello',bg='green',font=('Arial',12),width=15,height=2) x.pack() x.mainloop() 首先导入tkinter 模块,这个模块包括了所需要的所有的类和函数 然后,需要创建一个(根)窗口,它是一个普通的窗口,带有标题栏、最小化按钮、最大化按钮等,即:root = Tk() ,调用title接口,geometry分别设置根窗口的标题,大小。 然后我们就可以在该窗口上创建一个Label,即贴一个标签,这个Label可以显示文本、图标、图像等等。我们这里使用text来指定要显示的文本,而第一个参数root,表明x的父控件是root

Efficient allreduce is not supported for 2 IndexedSlices

佐手、 提交于 2021-01-26 04:13:55
问题 I am trying to run a Subclassed Keras Model on multiple GPUs. The code is running as expected, however, the following "warning" crops up during the execution of the code: "Efficient allreduce is not supported for 2 IndexedSlices" What does this mean? I followed the Multi-GPU tutorial on Tensorflow 2.0 Beta guide. I am also using the Dataset API for my input pipeline. 来源: https://stackoverflow.com/questions/56843876/efficient-allreduce-is-not-supported-for-2-indexedslices

Efficient allreduce is not supported for 2 IndexedSlices

一笑奈何 提交于 2021-01-26 04:13:53
问题 I am trying to run a Subclassed Keras Model on multiple GPUs. The code is running as expected, however, the following "warning" crops up during the execution of the code: "Efficient allreduce is not supported for 2 IndexedSlices" What does this mean? I followed the Multi-GPU tutorial on Tensorflow 2.0 Beta guide. I am also using the Dataset API for my input pipeline. 来源: https://stackoverflow.com/questions/56843876/efficient-allreduce-is-not-supported-for-2-indexedslices