
问题
大奸猫
哇哈哈哈哈哈
展开
-
TypeError: ‘str‘ object is not callable
文章目录问题原因解决问题在jupyternotebook中练习如下代码,提示错误:TypeError: ‘str’ object is not callabledef reverse(x: int) -> int: import math s = str(x) # 正负号 sign = 1 if s[0]=='-': sign = -1 s = s[1:] # 最大值 POS = str(原创 2020-08-04 15:07:20 · 1039 阅读 · 1 评论 -
InvalidArgumentError: indices[1] = [0,1247] is out of order. Many sparse ops require sorted indices.
文章目录问题原因解决问题用稀疏矩阵作为model的输入,提示错误:InvalidArgumentError: indices[1] = [0,1247] is out of order. Many sparse ops require sorted indices. Use `tf.sparse.reorder` to create a correctly ordered copy.原因稀疏矩阵的索引无序,如下所示:SparseTensor(indices=tf.Tensor([[原创 2020-07-28 15:23:51 · 2694 阅读 · 0 评论 -
ValueError: You cannot build your model by calling `build` if your layers do not support float type
文章目录问题原因解决问题tensorflow 2.2 要build一个模型,代码如下:model = GCN(UNITS) # 实例化一个模型# out = model([x,a])# print(out)model.build(input_shape=(None,FEATURE)) # 指定模型的输入形状出现错误提示:ValueError: You cannot build your model by calling `build` if your layers do not suppo原创 2020-07-28 12:04:22 · 8099 阅读 · 1 评论 -
You have not agreed to the Xcode license agreements. You must agree to both license agreements below
文章目录下载了xcode;然后,在mac终端运行命令时,出现You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.Hit the Return key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/En原创 2020-07-26 10:59:16 · 12313 阅读 · 1 评论 -
IndentationError: unexpected indent
文章目录问题原因解决问题 ''' 模型的学习共进行nb_epochs次; 每个epoch先进行迭代训练 N/batch_size 次,所有数据均参与,但计算损失时,会使用掩码只保留训练样本; 每个epoch再进行迭代验证 N/batch_size 次,所有数据均参与,但计算损失时,会使用掩码只保留验证样本; 模型学习完后,进行迭代验证 N/batch_size 次,所有数据都参与,但计算输出时,会使用掩码只保留测试样本; ''' # 开始训练原创 2020-07-22 11:39:09 · 1709 阅读 · 0 评论 -
ValueError: Integers to negative integer powers are not allowed.
文章目录问题原因解决问题运行下面代码,提示错误rowsum = np.array([1,2,3])r_inv = np.power(rowsum, -1)ValueError: Integers to negative integer powers are not allowed.原因rowsum 的 数据类型是整数,不是浮点数,只有浮点数才能进行power运算解决rowsum = np.array([1,2,3], dtype=np.float32)r_inv = np.power(原创 2020-07-22 10:42:03 · 8610 阅读 · 0 评论 -
NotFoundError: Could not find valid device for node. Node:{{node Sigmoid}}
文章目录问题原因解决问题tensorflow2 运行以下代码,出现问题。logits = tf.constant([[2, 7, 5]])y_pred = tf.math.sigmoid(logits)print(y_pred)NotFoundError: Could not find valid device for node.Node:{{node Sigmoid}}All kernels registered for op Sigmoid :原因logits = tf.const原创 2020-07-21 17:31:57 · 1578 阅读 · 0 评论 -
mac中jupyter notebook 使用虚拟环境
文章目录问题解决方案问题在mac终端上,用conda安装虚拟环境A后,打开jupyter notebook,发现只有在打开文件时,从菜单“服务”中,才能选择A;但每个文件都要这样选择就太麻烦了。解决方案在anaconda页面中,applications on 里,选择虚拟环境,出现jupyter notebook图标后,点击install, 安装完后,点击Launch,就可以进入该虚拟环境。...原创 2020-07-20 16:11:08 · 1162 阅读 · 0 评论 -
Collecting package metadata (current_repodata.json): done Solving environment: done
文章目录问题原因解决参考问题在mac终端中,用conda创建虚拟环境时,出现以下提示: ~ % conda create --name gat python=3.5.2Collecting package metadata (current_repodata.json): doneSolving environment: done~ %即直接结束,无法安装。原因用 conda clean --all 查看,在缓存文件夹 Cache location: xxx/.conda/pkgs 或者原创 2020-07-20 11:24:30 · 16800 阅读 · 2 评论 -
ERROR: Could not build wheels for pandas which use PEP 517 and cannot be installed directly
文章目录问题原因解决问题安装pandas: pip install pandas ,后台自动下载pandas 0.22.0版本;然后出错.... ---------------------------------------- ERROR: Failed building wheel for pandas Running setup.py clean for pandasFailed to build pandasERROR: Could not build wheels for pa原创 2020-07-19 16:53:55 · 17577 阅读 · 0 评论 -
Your shell has not been properly configured to use ‘conda activate‘.CommandNotFoundError:
文章目录问题原因解决方案问题创建了一个新环境openne,退出mac终端后,再重新打开终端,想登陆新环境,出现错误提示。Last login: Sat Jul 18 17:49:44 on ttys001xxx@xxx ~ % conda activate openneCommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.To initialize your shell原创 2020-07-18 18:03:55 · 1727 阅读 · 0 评论 -
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/osx-64
问题使用命令 conda search python ,出现错误:CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/main/osx-64/repodata.json% conda search pythonLoading channels: failedCondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://rep原创 2020-07-18 17:00:38 · 5276 阅读 · 0 评论 -
Jupyter Notebook切换到想要的环境
文章目录从base切换到了自定义的虚拟环境,现在想切换回去。在终端里面,已经激活的环境已经是base了,但jupyter notebook里面,运行代码,发现还是原来的自定义环境。只有到具体代码文件的页面,找到kernel菜单,然后选择base环境,如下所示但这样岂不是要一个个代码文件去切换,太麻烦了。...原创 2020-07-12 10:30:41 · 2005 阅读 · 0 评论 -
conda acitvate激活失效: Your shell has not been properly configured to use ‘conda activate‘.
文章目录问题原因解决参考问题在mac下的anaconda中创建了一个虚拟环境,想用 conda activate xxx 去激活,但是提示:ommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.To initialize your shell, run $ conda init <SHELL_NAME>Currently supported shell原创 2020-07-11 21:16:32 · 1270 阅读 · 0 评论 -
MAC中CondaHTTPError: HTTP 000 CONNECTION FAILED for url
文章目录问题原因解决问题mac中在安装虚拟环境 conda create --name tensorflow1.4python3.6 python=3.6 时,出现以下问题=================xxx ~ % conda create --name tensorflow1.4python3.6 python=3.6Collecting package metadata (current_repodata.json): failedCondaHTTPError: HTTP 000 CO原创 2020-07-11 20:42:46 · 2725 阅读 · 2 评论 -
WARNING:tensorflow:sample_weight modes were coerced from ... to [‘...‘]
文章目录问题原因解决问题训练代码:model.fit(graph, y, sample_weight=train_mask, batch_size=NUM, epochs=1, shuffle=False, verbose=0)出现提示:WARNING:tensorflow:sample_weight modes were coerced from … to [’…’]原因用的是tensorflow 2.1,2.2版就解决了这个问题解决安装tensorflow 2.2原创 2020-07-11 17:00:54 · 2738 阅读 · 0 评论 -
python修改导入包后,jupyter notebook只需重启服务清空输出
文章目录问题原因解决问题在jupyter notebook中运行python代码,代码中有一个包是自己编写的,一直在修正,但是每次import都会只保留最原始的版本,而不是最新的版本。然后每次都得退出jupyter notebook,再重新打开,才能导入最新版本原因因为首次导入包时,会有包缓存,再次运行代入代码,其实并没有真正再导入,而只是到包缓存中去取包,因此,这种方式只能取到最旧的包。解决重启服务,清空所有缓存,再重新运行代码,导入包。...原创 2020-07-11 11:05:23 · 2424 阅读 · 4 评论 -
TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0]
文章目录问题原因解决问题在跑Keras版GCN源码解析的时候,发现以下问题:TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0]原因在model.fit时,输入了特征矩阵,和邻接矩阵,但邻接矩阵A是<class ‘scipy.sparse.csr.csr_matrix’>。可能是fit函数接受不了’scipy.sparse.csr.csr_matrix’, 要加某些参数,但还不确定解决决定将邻接原创 2020-07-10 20:00:20 · 7892 阅读 · 2 评论 -
AttributeError: module ‘tensorflow‘ has no attribute ‘sparse_tensor_dense_matmul‘
文章目录问题原因解决问题原因Tensorflow2 已经没有 tf.sparse_tensor_dense_matmul(),变成tf.sparse.sparse_dense_matmul(st,dt)解决原创 2020-07-08 21:27:47 · 3742 阅读 · 0 评论 -
Error 1010 The PDF file may be corrupt (unable to open PDF file).
文章目录问题原因解决问题上传论文到ICPR的系统时,提示 Error 1010 The PDF file may be corrupt (unable to open PDF file).原因分部分上传,排查到论文中某个pdf图片,它是由python生成的,因为它导致上述错误出现。解决因为论文中有其他图片由PPT生成,并不会提示该错误,因此我把由python生成的该图片放入PPT中,重新导出为pdf,再上传,通过了真是奇葩,花了我好几个小时去排查错误...原创 2020-07-03 16:15:43 · 566 阅读 · 0 评论 -
Mac:www.jetbrains.com 拒绝了我们的连接请求。
文章目录问题原因解决问题想下载 pycharm,出现:www.jetbrains.com 拒绝了我们的连接请求。原因在hosts文件中已经配置了该网址的IP,但那IP是本地IP。导致找不到正确的IP。解决要把这些有关的IP给删掉。(1)查找出 hosts 文件在命令终端,打开hosts文件存放路径:open /private/etc ;搜索 hosts 文件 ;拷贝文件到桌面,用文本编辑器打开,可以发现:### Host Database## localhost is used t原创 2020-06-21 17:26:50 · 5818 阅读 · 0 评论 -
TypeError: unhashable type: list
文章目录问题原因解决方案问题在tensorflow中,自定义一个网络层,定义权重参数:self.w = self.add_weight( [pre, nex], trainable=True)时,出现问题:TypeError: unhashable type: ‘list’原因add_weight()函数中,第一个参数要是权重的名称,而不是shape形状(list数据类型)解决方案改为:self.w = self.add_weight( ‘w’,[pre, nex], trainable=Tru原创 2020-06-15 16:43:24 · 1263 阅读 · 0 评论 -
File ended while scanning use of l writefile. inserted text
文章目录问题解决方案问题tex在编译文件时,出现以下提示:解决方案把除开tex,bib,sty(有的人说要删除)之外的文件全部删除,重新再编译一次即可。原创 2020-05-29 10:26:25 · 3284 阅读 · 1 评论 -
训练时评估指标无变化,且预测值都一样
文章目录问题原因解决方案问题将特征全都标准化到 [0,1],设计了多层 Dense, 训练,发现评估指标一直不下降,而且预测值全部都相同,如下所示:原因看了一下激活函数用的是relu,因为relu的激活小于0全等于0,大于0就保持不变;猜测是全部都小于0,导致全部都等于0,于是对于所有样本都输出同一个预测值。解决方案激活函数改为tanh,性能评估指标发生了变化,预测值也发生变化...原创 2020-05-28 15:49:49 · 8327 阅读 · 6 评论 -
tensorflow2 No model found in config file.
文章目录问题原因解决方案问题用tensorflow2 自定义了一个模型,用checkpoint选择最优模型保存,但是在用 load_model()装载模型的时候遇到 No model found in config file.原因把模型给换成顺序模型,如下所示是没有问题的。原因在于,要保存h5文件,要求模型是 a Functional model 或者 a Sequential model,而对于subclassed models,我自己定义的模型应该属于这类,就不起作用,因为 isn’t原创 2020-05-28 14:46:41 · 8380 阅读 · 1 评论 -
mac无法验证此app不包含恶意软件
文章目录之前遇到这种情况命令打开 任何来源 安装即可,更新到10.15后解决不到这个问题。一、打开命令终端二、输入命令sudo xattr -rd com.apple.quarantine 然后拖入你要打开的软件,输入密码即可。密码是电脑的开机密码,不是AppStore的密码。...原创 2020-05-28 09:55:29 · 5571 阅读 · 1 评论 -
Latex编译论文时,多出一个空白页
文章目录问题原因解决方案问题IEEE journal的模板,在编译论文时,改了下作者那部分,很奇怪,编译的时候,第一页是空白的。原因在增加通讯作者时,把thanks{}信息写到maketitle部分上面了。解决方案把thanks{}信息写到maketitle部分下面。效果...原创 2020-05-23 17:41:32 · 18720 阅读 · 7 评论 -
latex 中 使用 \toprule 报错
文章目录问题原因解决方案问题用latex画表格时,使用\toprule报错原因Latex中写表格时需要用\toprule、\midrule、\bottomrule在宏包\usepackage{booktabs}中,没导入该宏包解决方案导入该宏包\usepackage{booktabs}...原创 2020-05-21 15:29:42 · 17769 阅读 · 4 评论 -
Package inputenc Error: Unicode character , (U+FFØC) (inputenc) not set up for use with L aTeX. See
文章目录问题原因解决方案问题用latex编译论文,出现以下错误y.tex.75: Package inputenc Error: Unicode character , (U+FFØC) (inputenc) not setup for use with L aTeX. See the inputenc package documentation for explanation.原因按提示,定位到第75行。发现有个逗号特别奇怪,是中文样式的逗号。解决方案去掉中文逗号,改为英文逗号...原创 2020-05-16 10:59:31 · 13194 阅读 · 0 评论 -
! LaTeX Error: Option clash for package hyperref.
文章目录原因解决方案结果上传论文到arxiv,在线编译时,出现以下错误提示:! LaTeX Error: Option clash for package hyperref.原因\usepackage[hidelinks]{hyperref} 跟其他package出现冲突解决方案去掉该包 %\usepackage[hidelinks]{hyperref}结果编译成功...原创 2020-05-11 14:20:58 · 17070 阅读 · 5 评论 -
File ended while scanning use of l writefile
文章目录问题解决方案问题tex在编译文件时,出现以下提示:解决方案把除开tex,bib,sty(有的人说要删除)之外的文件全部删除,重新再编译一次即可。原创 2020-05-11 13:00:00 · 603 阅读 · 0 评论 -
GraphViz's executables not found
没有安装GraphViz‘s executables.我是用pip安装的Graphviz,但是Graphviz不是一个python tool,你仍然需要安装GraphViz‘s executables.mac 下面安装 打开命令 brew install graphviz如果不行:sudo chown -R jack /usr/localbr...原创 2020-04-05 17:39:41 · 373 阅读 · 0 评论 -
No dashboards are active for the current data set.
问题打开tensorboard ,提示 No dashboards are active for the current data set.原因日志路径中有中文字符解决方案更改日志路径,让其全部是英文字符;打开 tensorboard,显示正常。...原创 2020-04-05 16:34:20 · 351 阅读 · 0 评论 -
mac jupterbook 无法在浏览器中打开
问题jupter book 点击 luanch后,下方的进度条闪烁了几秒,然后不闪烁了,无法在浏览器中打开。原因未知解决打开mac的终端,输入 jupyter notebook ,然后就在浏览器中打开了...原创 2020-03-30 21:38:32 · 434 阅读 · 0 评论 -
endnote x9 attach pdf 搞错了,解除attach
问题endnote x9,添加pdf到文献时,不小心把pdf贴错到错误的文献里去了解决为了删除错误的pdf,重新再贴,双击该文献条目,右边栏出现以下pdf页面,点击右键菜单,有个remove选项,点击remove即可删除...原创 2020-03-26 17:22:49 · 2173 阅读 · 0 评论 -
command not found: conda
问题在某些操作后,终端输入conda list,出现以下提示-sh command not found: conda 原因某些错误操作,让系统无法识别conda的路径。解决需要手动配置conda路径。在.zshrc中加入anaconda的路径。保存退出后 source 一下就可以。在终端中输入以下命令1)vim ~/.zshrc按下键i,进行编辑模式2)export PATH...原创 2020-03-26 11:05:00 · 4003 阅读 · 2 评论 -
The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bi
问题升级到macOS 10.15 Catalina打开终端,出现以下提示The default interactive shell is now zsh.To update your account to use zsh, please run `chsh -s /bin/zsh`.For more details, please visit https://support.apple....原创 2020-03-26 10:38:15 · 14390 阅读 · 0 评论 -
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:
问题更新mac系统到10.15.3后,安装git,打开终端出现问题:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunxcrun: error:...原创 2020-03-26 10:05:31 · 240 阅读 · 0 评论