草庐IT

nvidia-tensorflow

全部标签

python - 如何在 Tensorflow 中计算 R^2

我正在尝试在Tensorflow中进行回归。我不确定我是否正确计算了R^2,因为Tensorflow给我的答案与sklearn.metrics.r2_score不同有人可以看看我下面的代码,让我知道我是否实现了图中的方程式正确。谢谢total_error=tf.square(tf.sub(y,tf.reduce_mean(y)))unexplained_error=tf.square(tf.sub(y,prediction))R_squared=tf.reduce_mean(tf.sub(tf.div(unexplained_error,total_error),1.0))R=tf.m

python - TensorFlow - 根据另一个变量的形状动态定义变量的形状

假设我有一个张量x,其尺寸在图初始化时未定义。我可以使用以下方法得到它的形状:x_shape=tf.shape(input=x)现在,如果我想根据x_shape中定义的值创建一个变量,使用:y=tf.get_variable(variable_name="y",shape=[x_shape[0],10])我得到一个错误,因为传递给参数shape的值必须是int而不是Tensor。如何在不使用占位符的情况下创建这样一个动态形状的变量? 最佳答案 我的时间不多了,所以这是快速而肮脏的,但也许它可以帮助您找到解决方案...它基于这个(dy

python - 使用 argmax 在 tensorflow 中切片张量

我想在tensorflow中做一个动态损失函数。我想计算信号FFT的能量,更具体地说,只计算最主要峰值周围大小为3的窗口。我无法在TF中实现,因为它会抛出很多错误,例如Stride和InvalidArgumentError(回溯见上文):Expectedbegin,end,andstridestobe1Dequalsizetensors,但取而代之的是形状[1,64]、[1,64]和[1]。我的代码是这样的:self.spec=tf.fft(self.signal)self.spec_mag=tf.complex_abs(self.spec[:,1:33])self.argm=tf.c

python - 在 Tensorflow 中使用多层感知器模型预测文本标签

我正在学习教程并可以浏览代码,训练神经网络并评估其准确性。但我不知道如何在新的单个输入(字符串)上使用经过训练的模型来预测其标签。你能建议如何做到这一点吗?教程:https://medium.freecodecamp.org/big-picture-machine-learning-classifying-text-with-neural-networks-and-tensorflow-d94036ac2274session代码:#Launchthegraphwithtf.Session()assess:sess.run(init)#Trainingcycleforepochinran

Ubuntu下 NVIDIA Container Runtime 安装与使用

NVIDIAContainerRuntime官网GitHub仓库:Docker是开发人员采用最广泛的容器技术。借助NVIDIAContainerRuntime,开发人员只需在创建容器期间注册一个新的运行时,即可将NVIDIAGPU暴露给容器中的应用程序。用于Docker的NVIDIAContainerRuntime是托管在GitHub上的开源项目。文章目录简介安装环境要求开始安装使用示例添加NVIDIARuntime设置环境变量GPU枚举驱动功能约束DockerfileDockerComposeComposev2.3写法更精细的控制简介NVIDIAContainerRuntimeisaGPUa

Linux下安装NVIDIA显卡驱动(全流程通俗教程)

1、确认显卡型号查明你的NVIDIA显卡型号,以确保下载驱动程序的版本:lspci|grep-ivga2、下载NVIDIA驱动前往官方网站:NVIDIA官网选择显卡信息:使用下拉菜单选择正确的显卡型号、Linux操作系统和系统架构。下载驱动:点击"搜索"后,下载适用于你的系统的NVIDIA驱动程序。3、安装NVIDIA驱动将驱动传到服务器scpC:\Users\Downloads\NVIDIA-Linux-x86_64-535.86.05.runroot@xxx.xx.xx.xx:/data/安装驱动shNVIDIA-Linux-x86_64-535.86.05.run--no-opengl-

python - TensorFlow:Compat 弃用警告

注意:我的第一个问题在这里。请原谅缺乏细节或信息。如果需要,非常乐意澄清。我在Mac上运行TensorFlow1.0.0,并且在使用learn.Estimator类时不断收到此警告WARNING:tensorflow:From:25:callingfit(fromtensorflow.contrib.learn.python.learn.estimators.estimator)withyisdeprecatedandwillberemovedafter2016-12-01.Instructionsforupdating:EstimatorisdecoupledfromScikitLe

python - TensorFlow dynamic_rnn 回归量 : ValueError dimension mismatch

我想构建一个用于回归的玩具LSTM模型。This不错的教程对于初学者来说已经太复杂了。给定一个长度为time_steps的序列,预测下一个值。考虑time_steps=3和序列:array([[[1.],[2.],[3.]],[[2.],[3.],[4.]],...目标值应该是:array([4.,5.,...我定义了以下模型:#NetworkParameterstime_steps=3num_neurons=64#(arbitrary)n_features=1#tfGraphinputx=tf.placeholder("float",[None,time_steps,n_featur

python - 值错误 : Argument must be a dense tensor - Python and TensorFlow

我正在提取可能与我遇到的问题相关的部分代码:fromPILimportImageimporttensorflowastfdata=Image.open('1-enhanced.png')......raw_data=dataraw_img=raw_data我收到以下长消息,我不确定如何分析(您知道这里发生了什么吗):Traceback(mostrecentcalllast):File"C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py",line490,inapply_oppreferr

python - 使用 tensorflow 进行线性回归

我试图理解线性回归……这是我试图理解的脚本:'''AlinearregressionlearningalgorithmexampleusingTensorFlowlibrary.Author:AymericDamienProject:https://github.com/aymericdamien/TensorFlow-Examples/'''from__future__importprint_functionimporttensorflowastffromnumpyimport*importnumpyimportmatplotlib.pyplotaspltrng=numpy.rand