keras

Load keras model h5 unknown metrics

别等时光非礼了梦想. 提交于 2020-11-29 19:10:32
问题 I have trained a keras CNN monitoring the metrics as follow: METRICS = [ TruePositives(name='tp'), FalsePositives(name='fp'), TrueNegatives(name='tn'), FalseNegatives(name='fn'), BinaryAccuracy(name='accuracy'), Precision(name='precision'), Recall(name='recall'), AUC(name='auc'), ] and then the model.compile: model.compile(optimizer='nadam', loss='binary_crossentropy', metrics=METRICS) it works perfectly and I saved my h5 model (model.h5). Now I have downloaded the model and I would like to

Load keras model h5 unknown metrics

混江龙づ霸主 提交于 2020-11-29 19:08:29
问题 I have trained a keras CNN monitoring the metrics as follow: METRICS = [ TruePositives(name='tp'), FalsePositives(name='fp'), TrueNegatives(name='tn'), FalseNegatives(name='fn'), BinaryAccuracy(name='accuracy'), Precision(name='precision'), Recall(name='recall'), AUC(name='auc'), ] and then the model.compile: model.compile(optimizer='nadam', loss='binary_crossentropy', metrics=METRICS) it works perfectly and I saved my h5 model (model.h5). Now I have downloaded the model and I would like to

Load keras model h5 unknown metrics

邮差的信 提交于 2020-11-29 19:06:57
问题 I have trained a keras CNN monitoring the metrics as follow: METRICS = [ TruePositives(name='tp'), FalsePositives(name='fp'), TrueNegatives(name='tn'), FalseNegatives(name='fn'), BinaryAccuracy(name='accuracy'), Precision(name='precision'), Recall(name='recall'), AUC(name='auc'), ] and then the model.compile: model.compile(optimizer='nadam', loss='binary_crossentropy', metrics=METRICS) it works perfectly and I saved my h5 model (model.h5). Now I have downloaded the model and I would like to

Python can't apply fit_generator to keras model with multiple input

狂风中的少年 提交于 2020-11-29 10:35:12
问题 I have the following model - this is LSTM + CNN with 3 inputs. And I built this generator function to train the model using fit_generator (based on this: https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly): class MultiInputDataGenerator(keras.utils.Sequence): 'Generates data for Keras' def __init__(self, list_IDs, labels, shuffle=True): 'Initialization' self.batch_size = 8 self.labels = labels self.list_IDs = list_IDs self.n_classes = 5 self.shuffle = shuffle self.on

Python can't apply fit_generator to keras model with multiple input

喜你入骨 提交于 2020-11-29 10:34:10
问题 I have the following model - this is LSTM + CNN with 3 inputs. And I built this generator function to train the model using fit_generator (based on this: https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly): class MultiInputDataGenerator(keras.utils.Sequence): 'Generates data for Keras' def __init__(self, list_IDs, labels, shuffle=True): 'Initialization' self.batch_size = 8 self.labels = labels self.list_IDs = list_IDs self.n_classes = 5 self.shuffle = shuffle self.on

Google Colab - Your session crashed for an unknown reason

我只是一个虾纸丫 提交于 2020-11-29 09:24:08
问题 Your session crashed for an unknown reason when I run the following cell in Google Colab: from keras import backend as K if 'tensorflow' == K.backend(): import tensorflow as tf from keras.backend.tensorflow_backend import set_session config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.visible_device_list = "0" set_session(tf.Session(config=config)) I receive this message since I have uploaded two data sets to google drive. Does anyone know this message and can

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow)

强颜欢笑 提交于 2020-11-29 07:34:02
问题 I want to install tensorflow to use Keras LSTM I installed Keras, and i import this lines to my code. from keras.callbacks import LambdaCallback from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM from keras.optimizers import RMSprop Error is when runnig the code: No module named 'tensorflow' Cmd error when i write "pip install tensorflow" : ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)

也来玩玩目前最大的中文GPT2模型(bert4keras)

断了今生、忘了曾经 提交于 2020-11-27 20:50:27
©PaperWeekly 原创 · 作者|苏剑林 单位|追一科技 研究方向|NLP、神经网络 相信不少读者这几天都看到了清华大学与智源人工智能研究院一起搞的“清源计划”(相关链接 《中文版GPT-3来了?智源研究院发布清源 CPM —— 以中文为核心的大规模预训练模型》 ),里边开源了目前最大的中文 GPT2 模型 CPM-LM(26 亿参数),据说未来还会开源 200 亿甚至 1000 亿参数的模型,要打造“中文界的 GPT3”。 ▲ 官方给出的CPM-LM的Few Shot效果演示图 我们知道,GPT3 不需要 finetune 就可以实现 Few Shot,而目前 CPM-LM 的演示例子中,Few Shot 的效果也是相当不错的,让人跃跃欲试,笔者也不例外。既然要尝试,肯定要将它适配到自己的 bert4keras 中才顺手,于是适配工作便开始了。本以为这是一件很轻松的事情,谁知道踩坑踩了快 3 天才把它搞好,在此把踩坑与测试的过程稍微记录一下。 模型介绍 该计划发布的第一个模型称为 CPM-LM,参数大约为 26 亿,预训练中文数据规模 100GB,是一个单向的语言模型,其他细节大家自行到下面的链接阅读就好。这么大的参数量,一般我们都是直接使用而不考虑去 finetune 它的了,它所具备的能力就是无条件地随机生成文本,当然我们也可以实现给它一些引导,然后用它来实现文本续写

can we show underfitting with mobilenet?

时间秒杀一切 提交于 2020-11-25 03:33:28
问题 Are there any examples which could prove/demonstrate that we can see underfitting while classifying images with mobilenet too? I have tried transfer learning and feature extraction with mobilenet in ml5.js Since it's already trained on several thousand images, even when I add and train only 3 new images, I seem to get correct results. I am looking for an example such that I can demonstrate to the user that underfitting is possible with mobilenet as well. It could be by changing a particular

windows 10 Anaconda NVIDIA深度学习环境的搭建

懵懂的女人 提交于 2020-11-24 02:55:57
Anaconda笔记 镜像网站安装推荐。 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 添加特定源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ conda config --set show_channel_urls yes 查看更新源配置 conda config --show channels 按照必要环境 tensorflow-gpu install mingw libpython keras windows下Path环境变量太大的问题 解决办法是新建一个变量,比如EPath,然后将部分比较长的变量,放入其中。删除Path中已经放在EPath的变量,然后在Path加入%Epath%变量。在cmd命令中,输入Path,检查修改是否生效或成功。 网易邮箱,foxmail客户端报错554,需要在发邮件的时候,抄送一份给自己即可。 无法定位程序输入点 OPENSSL_sk_new_reserve 于动态链接库,解决方案