Lakshmi R
Lakshmi R

Reputation: 301

Notebook validation failed: Additional properties are not allowed ('id' was unexpected):

Getting below validation error on opening my notebook:

{
 "metadata": {
  "trusted": true
 },
 "id": "comparative-import",
 "cell_type": "code",
 "source": "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport nltk\nimport re\nimport gensim \nfrom gensim.utils import simple_preprocess\nfrom gensim.models.word2vec import Word2Vec\nfrom nltk.stem.porter import PorterStemmer\nfrom nltk.corpus import stopwords\nfrom sklearn.decomposition import PCA,TruncatedSVD\nfrom sklearn.manifold import TSNE\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom wordcloud import WordCloud, STOPWORDS, ImageColorGenerator\n",
 "execution_count": 10,
 "outputs": []
}

Upvotes: 11

Views: 12265

Answers (4)

Lakshmi R
Lakshmi R

Reputation: 301

I worked around the above issue by copying the contents of the cell instead of the entire cell (which copies also metadata).

Caution: this does not scale well for large notebooks (every cell has to be handled individually).

Upvotes: 8

Franz Knülle
Franz Knülle

Reputation: 391

id is simply not known for notebooks with nbformat below version 4.5.

You can open the notebook file in a text editor and increase the version.

In my case

 "nbformat": 4,
 "nbformat_minor": 4

becomes

 "nbformat": 4,
 "nbformat_minor": 5

For more details https://www.pythonfixing.com/2021/12/fixed-notebook-validation-failed-jupyter.html

Upvotes: 12

iqbal
iqbal

Reputation: 21

Try clear the output of all cells of your Jupyter Notebook. In Jupyter Notebook, Goto: cell>All Output>Clear

Upvotes: 2

Your notebook is just a bunch of import you can easily recreate it for this time I did it for you :

{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Untitled5.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "CRAF2wibMCRq"
      },
      "source": [
        "import numpy as np \n",
        "import pandas as pd\n",
        "import matplotlib.pyplot as plt\n",
        "import seaborn as sns\n",
        "import nltk\n",
        "import re\n",
        "import gensim \n",
        "from gensim.utils import simple_preprocess\n",
        "from gensim.models.word2vec import Word2Vec\n",
        "from nltk.stem.porter import PorterStemmer\n",
        "from nltk.corpus import stopwords\n",
        "from sklearn.decomposition import PCA,TruncatedSVD\n",
        "from sklearn.manifold import TSNE\n",
        "from sklearn.model_selection import train_test_split\n",
        "from sklearn.linear_model import LogisticRegression \n",
        "from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator"
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}

Upvotes: 0

Related Questions