tensorflow

AttributeError: module 'tensorflow' has no attribute 'get_default_graph'

扶醉桌前 提交于 2020-12-25 04:09:42
问题 I am doing some task related to image captioning and I have loaded the weights of inception model like this model = InceptionV3(weights='imagenet') But I am getting error like this: AttributeError: module 'tensorflow' has no attribute 'get_default_graph' What should I do? Please help. Here is the full output of above code. 1 . --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () 1 # Load the inception v3 model ---->

How to change python version in Anaconda?

眉间皱痕 提交于 2020-12-25 00:00:25
问题 I am trying to get into deep learning. I installed Anaconda to use jupyter and generally not to care about installing all of those packages like matplotlib etc myself. But I cannot install tensorflow as it works only with Python 3.4, 3.5, or 3.6 but I have 3.7. After I read about it I installed python 3.6.8. I uninstalled Anaconda and installed it again, nothing changed. After that, I used this command conda install python=3.6.8 to presumably install python 3.6.8 for it (I found this solution

How to change python version in Anaconda?

ぐ巨炮叔叔 提交于 2020-12-24 23:58:26
问题 I am trying to get into deep learning. I installed Anaconda to use jupyter and generally not to care about installing all of those packages like matplotlib etc myself. But I cannot install tensorflow as it works only with Python 3.4, 3.5, or 3.6 but I have 3.7. After I read about it I installed python 3.6.8. I uninstalled Anaconda and installed it again, nothing changed. After that, I used this command conda install python=3.6.8 to presumably install python 3.6.8 for it (I found this solution

How to change python version in Anaconda?

空扰寡人 提交于 2020-12-24 23:57:38
问题 I am trying to get into deep learning. I installed Anaconda to use jupyter and generally not to care about installing all of those packages like matplotlib etc myself. But I cannot install tensorflow as it works only with Python 3.4, 3.5, or 3.6 but I have 3.7. After I read about it I installed python 3.6.8. I uninstalled Anaconda and installed it again, nothing changed. After that, I used this command conda install python=3.6.8 to presumably install python 3.6.8 for it (I found this solution

How to change python version in Anaconda?

旧街凉风 提交于 2020-12-24 23:57:12
问题 I am trying to get into deep learning. I installed Anaconda to use jupyter and generally not to care about installing all of those packages like matplotlib etc myself. But I cannot install tensorflow as it works only with Python 3.4, 3.5, or 3.6 but I have 3.7. After I read about it I installed python 3.6.8. I uninstalled Anaconda and installed it again, nothing changed. After that, I used this command conda install python=3.6.8 to presumably install python 3.6.8 for it (I found this solution

anaconda tensorflow的安装以及jupyter notebook安装的问题解决

非 Y 不嫁゛ 提交于 2020-12-24 03:34:02
一、tensorflow安装报错及解决 问题:按照网上教程,利用pip install tensorflow,安装成功 import tensorflow 报错:ImportError:DLL load failed with error code -1073741795 解决:目测是版本问题,上述安装默认1.8版本,现降低安装的版本。 ①卸载原tensorflow ②pip install tensorflow==1.5 二、jupyter notebook安装的问题及解决 问题:安装网上教程安装jupyter notebook,无法改变程序的保存目录 解决: ① 按照网上步骤修改配置文件C:\Users\Administrator\.jupyter\jupyter_notebook_config.py,找到并修改 c.NotebookApp.notebook_dir =‘ 你的目录’, 并删除行前面的 # 号 ②将jupyter notebook运行文件发送到桌面快捷方式,右击=>属性=>目标=>删除末尾%USERPROFILE% 即可生效 来源: oschina 链接: https://my.oschina.net/u/4405299/blog/3902052

Should the custom loss function in Keras return a single loss value for the batch or an arrary of losses for every sample in the training batch?

不想你离开。 提交于 2020-12-23 09:40:26
问题 I'm learning keras API in tensorflow(2.3). In this guide on tensorflow website, I found an example of custom loss funciton: def custom_mean_squared_error(y_true, y_pred): return tf.math.reduce_mean(tf.square(y_true - y_pred)) The reduce_mean function in this custom loss function will return an scalar. Is it right to define loss function like this? As far as I know, the first dimension of the shapes of y_true and y_pred is the batch size. I think the loss function should return loss values for

Create an LSTM layer with Attention in Keras for multi-label text classification neural network

笑着哭i 提交于 2020-12-23 06:49:49
问题 Greetings dear members of the community. I am creating a neural network to predict a multi-label y. Specifically, the neural network takes 5 inputs (list of actors, plot summary, movie features, movie reviews, title) and tries to predict the sequence of movie genres. In the neural network I use Embeddings Layer and Global Max Pooling layers. However, I recently discovered the Recurrent Layers with Attention, which are a very interesting topic these days in machine learning translation. So, I

深度学习的一些经验总结和建议| To do v.s Not To Do

女生的网名这么多〃 提交于 2020-12-23 04:22:11
每天进步一点点,关注&置顶“ 我爱计算机视觉 ” CV君:本文作者为百度 PaddlePaddle 组技术布道师Charlotte77,内容全是实战经验的精炼总结,强烈推荐大家收藏。 除了列出来的内容,各位读者有什么独门秘籍也欢迎文末留言分享!截止到明晚23点(7月22日),留言被点赞最多的深度学习绝招,联系CV君(文末扫码)发50元红包! 昨天看到几篇不同的文章写关于机器学习的to do & not to do,有些观点赞同,有些不赞同,是现在算法岗位这么热门,已经不像几年前一样,可能跑过一些项目、懂点原理就可以了,现在对大家的要求更高,尤其工程能力更不可缺少,只跑过一些iris鸢尾花分类、啤酒与尿布、猫狗分类等的同学需要再提高提高,因为竞争太激烈了, 我在这里结合我自己的经验 总结一下 吧~ To Do 做项目时,边搜集数据可以边用已经搜集好的 少部分数据跑模型 。不用等到所有数据都搜集好了再跑。 不知道什么算法合适,可以直接把所有的算法都跑一遍,看效果再选择,多跑几个应用场景你就知道什么算法适合什么场景,什么数据对不同的算法会有什么影响了。 不知道什么参数是最佳参数,可以用random search或者grid search自动搜索最佳参数组合,有经验以后对于每个参数的大概范围心里会有个数。 一定要练习工程能力,只会调参的demo侠现在很难找到工作啦。 模型复现和刷题

TensorFlow Lite for Android示例

最后都变了- 提交于 2020-12-23 03:58:17
一、TensorFlow Lite TensorFlow Lite 是用于移动设备和嵌入式设备的轻量级解决方案。TensorFlow Lite 支持 Android、iOS 甚至树莓派等多种平台。 二、tflite格式 TensorFlow 生成的模型是无法直接给移动端使用的,需要离线转换成.tflite文件格式。 tflite 存储格式是 flatbuffers。 FlatBuffers 是由Google开源的一个免费软件库,用于实现序列化格式。它类似于Protocol Buffers、Thrift、Apache Avro。 因此,如果要给移动端使用的话,必须把 TensorFlow 训练好的 protobuf 模型文件转换成 FlatBuffers 格式。官方提供了 toco 来实现模型格式的转换。 三、API TensorFlow Lite 提供了 C ++ 和 Java 两种类型的 API。无论哪种 API 都需要加载模型和运行模型。 而 TensorFlow Lite 的 Java API 使用了 Interpreter 类(解释器)来完成加载模型和运行模型的任务。后面的例子会看到如何使用 Interpreter。 四、TensorFlow Lite实现手写数字识别 下面的 demo 中已经包含了 mnist.tflite 模型文件。(如果没有的话