笔记本验证失败 [英] Notebook Validation Failed

查看:274
本文介绍了笔记本验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行jupyter笔记本时,出现此错误.有什么主意吗?

 无效的笔记本可能无法正常运行.验证错误为:笔记本验证失败:['outputPrepend','outputPrepend','outputPrepend','outputPrepend','outputPrepend']具有非唯一元素:["outputPrepend","outputPrepend","outputPrepend","outputPrepend","outputPrepend"] 

解决方案

我遇到了同样的问题.我已经使用木星日志解决了这个问题.我的木星的日志是

 (venv)>jupyter笔记本[我18:12:33.188 NotebookApp]从本地目录提供笔记本:/home/engmrgh/Projects/[我18:12:33.188 NotebookApp] Jupyter Notebook在以下位置运行:[我18:12:33.188 NotebookApp] http://localhost:8888/?token = 3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4[I 18:12:33.189 NotebookApp]或http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4[I 18:12:33.189 NotebookApp]使用Control-C停止该服务器并关闭所有内核(两次跳过确认).[C 18:12:33.255 NotebookApp]要访问笔记本,请在浏览器中打开此文件:文件:///home/engmrgh/.local/share/jupyter/runtime/nbserver-6233-open.html或复制并粘贴以下URL之一:http://localhost:8888/?token = 3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4或http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4[E 18:12:42.647 NotebookApp]笔记本JSON无效:['outputPrepend','outputPrepend']具有非唯一元素无法验证code_cell ['properties'] ['metadata'] ['properties'] ['tags']中的'uniqueItems':在instance ['cells'] [38] ['metadata'] ['tags']上:['outputPrepend','outputPrepend'][W 18:12:42.707 NotebookApp]笔记本LDA.ipynb不可信[我18:12:44.126 NotebookApp]内核开始:28c189d6-a445-417a-9577-88fadd4464ea[我18:24:35.296 NotebookApp]将文件保存在/LDA.ipynb[W 18:24:35.296 NotebookApp]笔记本LDA.ipynb不可信 

以上日志的重要部分是:

在实例['cells'] [38] ['metadata'] ['tags']:['outputPrepend','outputPrepend']

基本上,它表示笔记本的单元格39中有问题(索引从0开始,所以38 + 1).当我启用元数据并转到单元格39时,通过单击单元格中出现的 metadata 按钮,我看到元数据的内容是为验证而显示的错误,删除内容解决了问题./p>

注意:要启用每个单元格的元数据,请遵循 View>单元格工具栏>如下图所示,编辑元数据.

While running jupyter notebook I get this error. Any idea?

An invalid notebook may not function properly. The validation error was:
Notebook validation failed: ['outputPrepend', 'outputPrepend', 'outputPrepend', 'outputPrepend', 'outputPrepend'] has non-unique elements:
[
 "outputPrepend",
 "outputPrepend",
 "outputPrepend",
 "outputPrepend",
 "outputPrepend"
]

解决方案

I had the same issue. And I have solved the issue using Jupiter logs. My Jupiter's log was

(venv) > jupyter notebook     
[I 18:12:33.188 NotebookApp] Serving notebooks from local directory: /home/engmrgh/Projects/
[I 18:12:33.188 NotebookApp] The Jupyter Notebook is running at:
[I 18:12:33.188 NotebookApp] http://localhost:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[I 18:12:33.189 NotebookApp]  or http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[I 18:12:33.189 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:12:33.255 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/engmrgh/.local/share/jupyter/runtime/nbserver-6233-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
     or http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[E 18:12:42.647 NotebookApp] Notebook JSON is invalid: ['outputPrepend', 'outputPrepend'] has non-unique elements
    
    Failed validating 'uniqueItems' in code_cell['properties']['metadata']['properties']['tags']:
    
    On instance['cells'][38]['metadata']['tags']:
    ['outputPrepend', 'outputPrepend']
[W 18:12:42.707 NotebookApp] Notebook LDA.ipynb is not trusted
[I 18:12:44.126 NotebookApp] Kernel started: 28c189d6-a445-417a-9577-88fadd4464ea
[I 18:24:35.296 NotebookApp] Saving file at /LDA.ipynb
[W 18:24:35.296 NotebookApp] Notebook LDA.ipynb is not trusted

The Important part of the above log is:

On instance['cells'][38]['metadata']['tags']: ['outputPrepend', 'outputPrepend']

Basically it says that there is something wrong in the cell 39 (index starts from 0, so 38+1) of the notebook. When I enabled the metadata and headed over to cell 39, by clicking on the metadata button appeared in the cell I saw that contents of metadata are the error shown for validation, deleting the contents solved the issue.

NOTE: To enable the metadata of each cell, follow View > Cell Toolbar > Edit Metadata as shown in the image below.

这篇关于笔记本验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆