草庐IT

Tensorflow-gpu

全部标签

python - Tensorflow,多标签准确率计算

我正在研究一个多标签问题,我正在尝试确定我的模型的准确性。我的模特:NUM_CLASSES=361x=tf.placeholder(tf.float32,[None,IMAGE_PIXELS])y_=tf.placeholder(tf.float32,[None,NUM_CLASSES])#createthenetworkpred=conv_net(x)#losscost=tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(pred,y_))#trainsteptrain_step=tf.train.AdamOptimizer(

python - 如何使用 tensorflow 进行 k 折交叉验证?

我关注theIRISexampleoftensorflow.我现在的情况是,我将所有数据放在一个CSV文件中,没有分开,我想对这些数据应用k折交叉验证。我有data_set=tf.contrib.learn.datasets.base.load_csv(filename="mydata.csv",target_dtype=np.int)如何使用与IRIS示例相同的多层神经网络对这个数据集执行k折交叉验证? 最佳答案 我知道这个问题很老,但如果有人想做类似的事情,请在ahmedhosny's上进行扩展答案:新的tensorflow数据

python - 如何 pip 安装旧版本的库(tensorflow)?

我正在尝试安装tensorflowr0.11。我试过了pipinstalltensorflow==r0.11pipinstalltensorflow但我得到了这个错误Couldnotfindaversionthatsatisfiestherequirementtensorflow==0.11.0(fromversions:0.12.0rc0,0.12.0rc1,0.12.0,0.12.1)Nomatchingdistributionfoundfortensorflow==0.11.0我假设pip不再支持贬值版本,我怎样才能得到它?我也试过pipinstallgit+git://gith

python - 如何让 Keras 在 Anaconda 中使用 Tensorflow 后端?

我已经在我的Anaconda环境中安装了tensorflow-gpu。他们都运作良好。现在我正在尝试使用Tensorflow后端安装Keras。根据instruction我只是跑:pipinstallkeras但是它没有安装keras,然后我试了一下:condainstall-cconda-forgekeras=2.0.2然后我现在可以在python中导入keras。但问题是,它总是使用Theano后端。我正在尝试改变这一点,但不知道该怎么做。我也尝试编辑文件~/.keras,但实际上默认后端已经是tensorflow。请帮忙..非常感谢! 最佳答案

python - 更改 TensorFlow 中的默认 GPU

根据文档,默认GPU是id最低的:IfyouhavemorethanoneGPUinyoursystem,theGPUwiththelowestIDwillbeselectedbydefault.是否可以通过命令行或一行代码更改此默认设置? 最佳答案 Suever'sanswer正确显示了如何将您的操作固定到特定的GPU。但是,如果您在同一台机器上运行多个TensorFlow程序,建议您设置CUDA_VISIBLE_DEVICES环境变量以在启动进程之前公开不同的GPU。否则,TensorFlow将尝试在所有可用的GPU上分配几乎全

python - TensorFlow:如何在培训期间多次评估验证数据队列?

DR如何在每次k训练迭代后评估验证集,使用单独的训练和验证数据队列,而不在多个流程中使用单独的tf.Sessions考虑到我的特殊问题,似乎没有一个干净的方法来实现这一点,而我目前的解决方法(我认为可行)给了我未定义的行为。救命!整个故事我想在每k次训练迭代中评估一个验证集,但我无法理解如何在TensorFlow中正确地实现这个验证集。这应该是最常见的操作之一,但它认为TensorFlow的API/体系结构在这里对我不利,或者至少使事情变得不必要的困难。我的假设是:[A1]此处所述的用于培训/验证的多进程模型不适用于我的问题,因为我必须假设没有足够的GPU内存来加载两次变量。[A2]我

python - 使用 `tensorflow.python.keras.estimator.model_to_estimator` 将 Keras 模型转换为 Estimator API 时如何通知类权重?

我在将纯Keras模型转换为不平衡数据集上的TensorFlowEstimatorAPI时遇到了一些麻烦。使用纯KerasAPI时,class_weight参数在model.fit方法中可用,但在使用tensorflow.python将Keras模型转换为TensorFlowEstimator时.keras.estimator.model_to_estimator没有地方通知class_weights。如何克服这个问题?我在Ubuntu18、Cuda9、Cudnn7上使用TF1.12纯Keras模型:defkeras_model(n_classes=None,model_dir='./

python - TensorFlow 分配内存 : Allocation of 38535168 exceeds 10% of system memory

使用ResNet50预训练的权重我正在尝试构建一个分类器。代码库完全在Keras高级TensorflowAPI中实现。完整代码发布在下面的GitHub链接中。源代码:ClassificationUsingRestNet50Architecture预训练模型的文件大小为94.7mb。我加载了预训练的文件new_model=Sequential()new_model.add(ResNet50(include_top=False,pooling='avg',weights=resnet_weight_paths))并拟合模型train_generator=data_generator.flo

python - Windows 上的 TensorFlow 版本 1.0.0-rc2 : "OpKernel (' op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits"with test code

我在Windows7SP1x64Ultimate(Python3.5.2|Anacondacustom(64-bit))上安装了TensorFlow版本1.0.0-rc2,使用:pipinstall--upgradehttps://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl当我尝试从https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_

python - 如何使用 TensorFlow GPU?

如何在Python3.6x64中使用TensorFlowGPU版本而不是CPU版本?importtensorflowastfPython正在使用我的CPU进行计算。我可以注意到它,因为我有一个错误:YourCPUsupportsinstructionsthatthisTensorFlowbinarywasnotcompiledtouse:AVX2我已经安装了tensorflow和tensorflow-gpu。如何切换到GPU版本? 最佳答案 按照本教程TensorflowGPU我做到了,效果很好。注意!-安装9.0版!Tensorf