草庐IT

tensorflow-slim

全部标签

python - 使用 Rstudio 安装 keras 和 tensorflow

尝试按照在Rstudio链接上安装Keras和TensorFlow的说明进行操作时https://keras.rstudio.com/index.html我收到以下错误。这是一台运行Windows7的工作计算机。我不熟悉python,但我相信我已经正确安装了python3.6(我能够在SpyderIDE中运行简单的python代码)。在此先感谢您提供有关如何使此工作正常进行的任何建议。>install_keras()Creatingr-tensorflowcondaenvironmentforTensorFlowinstallation...Solvingenvironment:...

android - 将经过训练的 Tensorflow 模型转换为 protobuf

AndroidTensorflowDemo中的初始网将模型存储为protobuf文件(tensorflow_inception_graph.pb)。我想用另一个网络替换这个网络。是否有关于如何将经过训练的Python中的TensorFlow网络转换为.pb的文档或示例?我知道TensorFlow的Saver但这似乎是用来保存中间训练状态的。如果模型已经过训练,则不确定它是如何工作的。 最佳答案 这是一个saving的例子和loading 关于android-将经过训练的Tensorflo

python - 如何计算 Tensorflow 中的所有二阶导数(仅 Hessian 矩阵的对角线)?

我有一个损失值/函数,我想计算关于张量f(大小为n)的所有二阶导数。我设法使用了tf.gradients两次,但在第二次应用它时,它对第一个输入的导数求和(请参阅我的代码中的second_derivatives)。我还设法检索了Hessian矩阵,但我只想计算它的对角线以避免额外计算。importtensorflowastfimportnumpyasnpf=tf.Variable(np.array([[1.,2.,0]]).T)loss=tf.reduce_prod(f**2-3*f+1)first_derivatives=tf.gradients(loss,f)[0]second_d

python - TensorArray 和 while_loop 如何在 tensorflow 中协同工作?

我正在尝试为TensorArray和while_loop的组合生成一个非常简单的示例:#1000sequenceinthelengthof100matrix=tf.placeholder(tf.int32,shape=(100,1000),name="input_matrix")matrix_rows=tf.shape(matrix)[0]ta=tf.TensorArray(tf.float32,size=matrix_rows)ta=ta.unstack(matrix)init_state=(0,ta)condition=lambdai,_:i但是我收到以下错误:ValueError

python - 如何在 TensorFlow 中使用 "group_by_window"函数

在TensorFlow的新输入管道函数集中,可以使用“group_by_window”函数将记录集分组在一起。它在此处的文档中进行了描述:https://www.tensorflow.org/api_docs/python/tf/contrib/data/Dataset#group_by_window我不完全理解这里用来描述功能的解释,我倾向于通过示例来学习。我无法在互联网上的任何地方找到此功能的任何示例代码。有人可以为此功能制作一个准系统和可运行的示例来展示它是如何工作的,以及为这个功能提供什么? 最佳答案 对于tensorflo

python - Tensorflow:如何设置对数尺度的学习率和一些 Tensorflow 问题

我是一名深度学习和Tensorflow初学者,我正在尝试在此paper中实现算法使用tensorflow。本文使用Matconvnet+Matlab实现,好奇Tensorflow有没有等价的功能来实现同样的事情。论文说:ThenetworkparameterswereinitializedusingtheXaviermethod[14].Weusedtheregressionlossacrossfourwaveletsubbandsunderl2penaltyandtheproposednetworkwastrainedbyusingthestochasticgradientdesce

python - 如何计算 Tensorflow Object Detection API 中的对象

我正在执行https://github.com/tensorflow/tensorflow这个检测图像中物体的例子。我想计算检测到的对象的数量,下面是给我在图像中绘制的检测到的对象的代码。但是我无法计算检测到的对象。withdetection_graph.as_default():withtf.Session(graph=detection_graph)assess:forimage_pathinTEST_IMAGE_PATHS:image=Image.open(image_path)#thearraybasedrepresentationoftheimagewillbeusedlat

python - 如何让 VirtualEnv TensorFlow 在 PyCharm 中工作?

所以我通过这里的主要响应将tensorflow安装到我的mac上:https://stackoverflow.com/a/33691154/6095482这意味着我的tensorflow在vi​​rtualenv中工作。我可以通过我的终端运行它来编写脚本,但想知道是否有任何方法可以将它移植到IDE上。我熟悉pycharm,但无法弄清楚路径路由和虚拟环境以使其运行。有没有人对在哪里使用它以及哪个IDE更好有任何建议?谢谢! 最佳答案 您已经在virtualenv中安装了tensorflow,以下是让PyC​​harm使用它的方法:首先

python - Tensorflow——keras model.save() 引发 NotImplementedError

importtensorflowastfmnist=tf.keras.datasets.mnist(x_train,y_train),(x_test,y_test)=mnist.load_data()x_train=tf.keras.utils.normalize(x_train,axis=1)x_test=tf.keras.utils.normalize(x_test,axis=1)model=tf.keras.models.Sequential()model.add(tf.keras.layers.Flatten())model.add(tf.keras.layers.Dense(

python - 将python opencv mat图像转换为tensorflow图像数据

我想用python和opencv从视频中捕获帧,然后用tensorflow对捕获的Mat图像进行分类。问题是我不知道如何将deMat格式转换为3D张量变量。这就是我现在使用tensorflow的方式(从文件加载图像):image_data=tf.gfile.FastGFile(imagePath,'rb').read()withtf.Session()assess:softmax_tensor=sess.graph.get_tensor_by_name('final_result:0')predictions=sess.run(softmax_tensor,{'DecodeJpeg/c