摘要: 输入不对应 报错内容: WARNING:tensorflow:Model was constructed with shape (None, 79) for input Tensor("genres:0", shape=(None, 79), dtype=float32), but it was c 阅读全文
posted @ 2020-11-26 18:32 oaksharks 阅读(2184) 评论(0) 推荐(0) 编辑
摘要: Tensor 在TF中用来存储数据,有点像Spark 中的RDD,用来表示一个集合,里面可能在计算后才有数据,它是TF中常用的数据结构,作为网络层的输入和输出。 把python中的数据变成一个Tensor: import tensorflow as tf print(tf.constant([[1, 阅读全文
posted @ 2020-11-26 18:25 oaksharks 阅读(316) 评论(0) 推荐(0) 编辑
摘要: # -*- encoding: utf-8 -*- import tensorflow as tf # 定义一张4单通道*4图片 # data = tf.random.truncated_normal(shape=(1, 1, 4, 4)) data = tf.constant( [[[[1, 2, 阅读全文
posted @ 2020-11-24 10:43 oaksharks 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 初始化 默认使用conda activate 命令时会报错,需要给zsh初始化conda配置: conda init zsh 这样默认启动zsh时会会激活一个base虚拟环境,它是把激活命令写到文件.zshrc了。 环境变量的操作 # 删除 conda remove -n your_env_name 阅读全文
posted @ 2020-11-17 15:53 oaksharks 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 真阳性率(tpr),正例算对的,越高越好, 假阳性率(fpr),正例算错的,越低越好, 一个好的模型应该tpr很高,fpr很低,这种模型识别正例的能力很强,就用 fpr-tpr得到一个值,如果移动阈值,得到fpr和tpr曲线,找在同一个概率下 tpr和fpr最大的差值作为KS((Kolmogorov 阅读全文
posted @ 2020-11-12 14:26 oaksharks 阅读(2192) 评论(0) 推荐(0) 编辑
摘要: 用在可视化进程管理上,作为一个运维工具可以在web页面上查看程序日志、重启程序,并监控状态。 应用场景分析: 开发过程中经常涉及到程序的排错、重启。 重启会在持续集成做,但是需要写脚本,如果基于docker的,通常会: docker rm -f xxx docker run ... 如果是在宿主机上 阅读全文
posted @ 2020-11-12 13:43 oaksharks 阅读(157) 评论(0) 推荐(0) 编辑
摘要: npm 是 node package manager,yarn不仅可以管理安装包,还能管理开发环境。 pip 默认就把依赖安装到对应的python目录,它是所有python应用共享一个依赖库,node默认是每个应用独享自己的依赖库,可以避免不同应用的依赖冲突, 类似python给每个应用都创建一个虚 阅读全文
posted @ 2020-11-11 20:20 oaksharks 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 定义宏文件/tmp/my_macro.jinja2: {% macro print_hello(i) -%}hello, {{ i }}{%- endmacro %} 在另外一个文件/tmp/main.jinja2中使用宏: {# 这样导入的宏代码无法访问上下文变量,如果需要访问加上 with co 阅读全文
posted @ 2020-10-22 16:54 oaksharks 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 转载的,出处找不到了,记录一下: Select Inputs Here the focus is on the quality of your data, specifically the quality of each column of data. You may want to conside 阅读全文
posted @ 2020-09-29 15:08 oaksharks 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1. 安装 npm 通过npm 来安装node apt-get install -y npm 2. 升级nodejs sudo npm install -g n sudo n stable node --version 3. 下载项目依赖 # 使用国内源 npm config set registr 阅读全文
posted @ 2020-09-17 14:44 oaksharks 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 验证: $ docker images |grep cookdata test-cache 1.0.0 fededff87eb2 About a minute ago 6.2GB (base) [wuhf@aps ~]$ docker pull test-cache:1.0.0 1.0.0: Pul 阅读全文
posted @ 2020-09-17 10:25 oaksharks 阅读(1978) 评论(0) 推荐(0) 编辑
摘要: 方法一: # -*- encoding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt y_score=[2.5710e-05,7.6021e-04,9.9500e-01,4.9876e-04,8.4120e-01,9.99 阅读全文
posted @ 2020-09-14 13:43 oaksharks 阅读(700) 评论(0) 推荐(0) 编辑
摘要: 代码: # -*- encoding: utf-8 -*- import matplotlib.pyplot as plt from sklearn.metrics import roc_curve, auc y_score=[2.5710e-05,7.6021e-04,9.9500e-01,4.9 阅读全文
posted @ 2020-09-14 13:38 oaksharks 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 复制本地端口: ssh -R 8023:0.0.0.0:8022 0.0.0.0 或者: ssh -L 8023:0.0.0.0:8022 0.0.0.0 阅读全文
posted @ 2020-09-11 19:19 oaksharks 阅读(115) 评论(0) 推荐(0) 编辑
摘要: ps -ef | grep "name" | grep -v grep | awk '{print $2}' | xargs kill -9 阅读全文
posted @ 2020-09-11 19:10 oaksharks 阅读(150) 评论(1) 推荐(1) 编辑
摘要: 问题说明 当从一个https的registry 拉取镜像,并且这个registry的证书不是指定机构颁发的时会出现无法拉取镜像的问题。 解决方法 让docker 信任registry的证书,它有一个目录在 /etc/docker/certs.d,一个例子: # pwd ls -l /etc/dock 阅读全文
posted @ 2020-09-10 18:21 oaksharks 阅读(890) 评论(0) 推荐(0) 编辑
摘要: pip2pi可以将应用的所有依赖都下载并生成一个本地源,相当于yum的repotrack+createrepo pip install pip2pi 下载并创建源: pip2pi /home/oaksharks/install/pipRepo/packages -i https://pypi.dou 阅读全文
posted @ 2020-09-04 17:33 oaksharks 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 利用本地源解决在无网环境部署应用需要解决的问题: 应用需要哪些软件包? 如何把应用依赖的软件包制作成一个精简的本地源? 如何使用本地源? 第一个问题使用yum-utils解决,它带的repotrack 命令可以把应用所依赖的软件包全部下载到本地,安装: yum install -y yum-util 阅读全文
posted @ 2020-09-04 16:29 oaksharks 阅读(898) 评论(0) 推荐(0) 编辑
摘要: 配置 linux/mac配置文件地址: ~/.pip/pip.conf windows配置地址:%APPDATA%\pip\pip.ini or %HOME%\pip\pip.ini,实测为前者 配置源: [global] timeout = 60 index-url = https://pypi. 阅读全文
posted @ 2020-09-01 12:44 oaksharks 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 1. pd.DataFrame 1.1. 获取schema import pandas as pd df = pd.DataFrame(data={"age": [1, 2, 3], "name": ['a', 'b', 'c']}) print(df.dtypes) 输出: age int64 n 阅读全文
posted @ 2020-08-26 20:14 oaksharks 阅读(170) 评论(0) 推荐(0) 编辑