原创 bisect解析
a=[1,3,5,8,11] b=list(map(lambda x:bisect.bisect_right(a,x),[2,7,10,12])) b [1, 3, 4, 5] bisect.bisect_right 是將[2,7,10
原创 psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory compilation termi
這個導致tensorflow 安裝不上以及其他的包 無法安裝 可以 sudo yum install python-devel sudo yum install python3-devel
原创 將tensorflow模型 固化之後再次 加載 模型很差
tf.train.Saver().save 保存graph和參數是分開的 然後 使用write_graph 只是保存了graph 所以要使用 bazel 來固化模型 https://blog.csdn.net/huangjx07
原创 windows10 家庭版 安裝docker
專業版 和企業版 和教育版 安裝docker 1首先看電腦 是否支持 虛擬化 需要安裝hyper-v Docker for Windows 家庭版安裝docker 但是Docker Toolbox是用VirtualBox的 不能安裝
原创 tf.gather()
import numpy as np import tensorflow as tf sess=tf.InteractiveSession() a=tf.constant([5,5,6,6,3,3]) b=tf.reshape(tf.r
原创 Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a
python -m spacy download en_core_web_sm python -m spacy download en
原创 安裝了 tensorflow-gpu 但是 導入 import tensorflow 時 卻無法導入
pip install tensorflow-gpu 安裝之後 導入 import tensorflow 時 卻無法導入 , 應該是安裝 tensorflow-gpu 的版本 和cuda的版本不一致
原创 在不同系統下 正則的效果是不一樣的
fl='./data/seq2seq_results-0\\seq2seq_0_0.model 在 arr = re.split('\/', fl_)[-1] 在windows下的結果 和 centos 的結果是不一樣的 在windows
原创 Ubuntu 安裝 Levenshtein 出現 venshtein.c:99:20: fatal error: Python.h: No such file or directory
Levenshtein/_levenshtein.c:99:20: fatal error: Python.h: No such file or directory compilation terminated. erro
原创 Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
長度可以不一樣的語言模型 (就是依賴下一層和下一層的前一段) https://arxiv.org/pdf/1901.02860.pdf transformer 框架有學習
原创 java 調用python 模型 Cannot find TensorFlow native library for OS: windows, architecture: x86.
jdk 有32位 64位之分 tensorflow python安裝64位 那麼 jdk也應該是64位
原创 java 調用python 模型
import org.apache.commons.lang3.StringUtils; import org.tensorflow.Graph; import org.tensorflow.Session; import org.
原创 轉載 intellij IDE Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
原文 https://blog.csdn.net/weixin_37595559/article/details/78903957 <div class="htmledit_views" id="content_views">
原创 jython 將py 文件變成 .class 文件
jython -m compileall tokenization.py 編譯後的文件名字爲 tokenization$py.class jython 如何安裝 百度一下 下載 jython-installer-2.7.0.jar 直
原创 torch.narrow()
import torch.tensor x=torch.rand(5,6) x tensor([[0.4606, 0.0850, 0.8009, 0.3972, 0.9548, 0.5982], [0.4821, 0.