tensorflow

InvalidArgumentError: input must be a vector, got shape: []

一曲冷凌霜 提交于 2021-01-24 11:25:06
问题 I m trying to save the embeddings of text data using universal sentence encoder in pandas dataframe new column but getting the error. Here is what I am trying to do. module_url = "https://tfhub.dev/google/universal-sentence-encoder/4" #@param ["https://tfhub.dev/google/universal-sentence-encoder/4", "https://tfhub.dev/google/universal-sentence-encoder-large/5"] model = thub.load(module_url) print ("module %s loaded" % module_url) def embed(input): return model(input) then for t in list(df[

InvalidArgumentError: input must be a vector, got shape: []

久未见 提交于 2021-01-24 11:23:50
问题 I m trying to save the embeddings of text data using universal sentence encoder in pandas dataframe new column but getting the error. Here is what I am trying to do. module_url = "https://tfhub.dev/google/universal-sentence-encoder/4" #@param ["https://tfhub.dev/google/universal-sentence-encoder/4", "https://tfhub.dev/google/universal-sentence-encoder-large/5"] model = thub.load(module_url) print ("module %s loaded" % module_url) def embed(input): return model(input) then for t in list(df[

conda 更换python版本

夙愿已清 提交于 2021-01-24 09:56:14
如将Anaconda 中默认版本Python3.7 版本修改成3.5 执行下列命令即可 conda install python=3.7.4 自动会卸载之前的版本,更新新的版本。 不过换了版本以后,第三方库也都需要重新安装,比如opencv,torch 其中TensorFlow 1.15版本需要单独下载,不支持,python3.8版本 下载网址: https://pypi.org/project/tensorflow/1.15.0/#files 感谢: https://blog.csdn.net/qq_31904559/article/details/84309756 来源: oschina 链接: https://my.oschina.net/u/4391345/blog/4921930

Why it's necessary to frozen all inner state of a Batch Normalization layer when fine-tuning

时间秒杀一切 提交于 2021-01-24 09:38:51
问题 The following content comes from Keras tutorial This behavior has been introduced in TensorFlow 2.0, in order to enable layer.trainable = False to produce the most commonly expected behavior in the convnet fine-tuning use case. Why we should freeze the layer when fine-tuning a convolutional neural network? Is it because some mechanisms in tensorflow keras or because of the algorithm of batch normalization? I run an experiment myself and I found that if trainable is not set to false the model

Best loss function for multi-class classification when the dataset is imbalance?

谁说我不能喝 提交于 2021-01-24 07:42:31
问题 I'm currently using the Cross Entropy Loss function but with the imbalance data-set the performance is not great. Is there better lost function? 回答1: It's a very broad subject, but IMHO, you should try focal loss: It was introduced by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollar to handle imbalance prediction in object detection. Since introduced it was also used in the context of segmentation. The idea of the focal loss is to reduce both loss and gradient for correct

Best loss function for multi-class classification when the dataset is imbalance?

被刻印的时光 ゝ 提交于 2021-01-24 07:40:09
问题 I'm currently using the Cross Entropy Loss function but with the imbalance data-set the performance is not great. Is there better lost function? 回答1: It's a very broad subject, but IMHO, you should try focal loss: It was introduced by Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He and Piotr Dollar to handle imbalance prediction in object detection. Since introduced it was also used in the context of segmentation. The idea of the focal loss is to reduce both loss and gradient for correct

Tensorflow SavedModel ignoring Assets File on Load

独自空忆成欢 提交于 2021-01-24 07:13:26
问题 I fine-tuned a BERT model from Tensorflow hub to build a simple sentiment analyzer. The model trains and runs fine. On export, I simply used: tf.saved_model.save(model, export_dir='models') And this works just fine.. until I reboot. On a reboot, the model no longer loads. I've tried using a Keras loader as well as the Tensorflow Server, and I get the same error. I get the following error message: Not found: /tmp/tfhub_modules/09bd4e665682e6f03bc72fbcff7a68bf879910e/assets/vocab.txt; No such

Tensorflow SavedModel ignoring Assets File on Load

爷,独闯天下 提交于 2021-01-24 07:11:46
问题 I fine-tuned a BERT model from Tensorflow hub to build a simple sentiment analyzer. The model trains and runs fine. On export, I simply used: tf.saved_model.save(model, export_dir='models') And this works just fine.. until I reboot. On a reboot, the model no longer loads. I've tried using a Keras loader as well as the Tensorflow Server, and I get the same error. I get the following error message: Not found: /tmp/tfhub_modules/09bd4e665682e6f03bc72fbcff7a68bf879910e/assets/vocab.txt; No such

岗位内推 | 阿里巴巴设备风控团队招聘高级数据挖掘工程师

空扰寡人 提交于 2021-01-23 13:18:17
PaperWeekly 致力于推荐最棒的工作机会,精准地为其找到最佳求职者,做连接优质企业和优质人才的桥梁。如果你需要我们帮助你发布实习或全职岗位,请添加微信号 「pwbot02」 。 阿里安全设备风控团队招人啦~ 团队站在黑灰产攻防技术前沿,服务于整个阿里数字经济体。是集团唯一一只专注于设备风控及设备指纹的团队。团队技术氛围浓厚、小伙伴专业靠谱,包括但不限于 frida-ios-dump 作者、GeekPwn 获奖选手、CTF 大佬。在这里,基于复杂业务场景的攻防对抗每天都在发生。数字技术正在构建前所未有的全新世界,身处变化的前沿,我们面对的是互联网企业中最为丰富的业态和风险。毫无疑问,这是对检验和提升自身能力最好的练兵场。 高级数据挖掘工程师 工作地点: 杭州 薪资: 提供业内有竞争力的薪资,具体视能力而定。 岗位描述: 1. 挖掘并分析设备行为序列,搭建异常检测模型; 2. 应用机器学习相关技术,挖掘异常数据; 3. 安全检测领域前沿技术跟踪,结合已有数据基础,进行原型系统的研发和验证。 岗位要求: 1. 良好的逻辑思考能力,可以从海量数据中挖掘出有价值的规律; 2. 熟悉至少一种常用深度学习框架(Tensorflow, PyTorch); 3. 熟悉异常检测常用算法及评价指标; 4. ASR、NLP 及时间序列信号分析相关领域经验优先; 5. 天池、Kaggle

人工智能 机器学习 深度学习

夙愿已清 提交于 2021-01-23 13:07:37
人工智能、机器学习、深度学习这些名词经常会在各种场合听到,那具体有哪些区别呢? 在业内来说,这几个概念还是有区别的,如果混用就会让人觉得是个门外汉。 为了避免露馅成为 外行 ,下面就来具体介绍一下每个概念以及它们之间的区别。 人 工智能 : 模拟、延伸和扩展人的智能的理论、方法、技术及应用系统 。 人工智能是个很宽泛的 概念 ,人类制造了各种机器之后,总希望这些机器越来越智能,这样人就可以越来越轻松,更好地享受生活。 例如上图中提到的AGI(Artificial General Intelligence,通用人工智能),就是真正的AI,可以达到人类心智水平、能够通过图灵测试的机器(图灵测试的介绍见附录)。 但事实上,现在的机器在很多方面都已经远远超过了人类,但是也有一些方面和人类差距还非常大。 例如进行计算,人类早已没法和机器PK,电脑的学名正是计算机,用来计算的机器,计算能力非常强大,计算速度非常快。 但是有些方面的任务,比如操作灵活性,机器人还和人类有一定的差距; 还有理解能力,机器在很多场景还都无法理解人类的意图,仍需要不断发展。 机器学习 : 研究计算机怎样模拟或实现人类的学习行为 。 机器学习的范围要窄一些,是一个具体的交叉 学科 ,算法也非常多: 随机森林、决策树、朴素贝叶斯分类、SVM(Support Vector Machine, 支持向量机)等等。