jupyter-notebook

Keras AttributeError: 'list' object has no attribute 'ndim'

情到浓时终转凉″ 提交于 2019-12-06 18:29:50
问题 I'm running a Keras neural network model in Jupyter Notebook (Python 3.6) I get the following error AttributeError: 'list' object has no attribute 'ndim' after calling the .fit() method from Keras.model model = Sequential() model.add(Dense(5, input_dim=len(X_data[0]), activation='sigmoid' )) model.add(Dense(1, activation = 'sigmoid')) model.compile(loss='mean_squared_error', optimizer='adam', metrics=['acc']) model.fit(X_data, y_data, epochs=20, batch_size=10) I checked the requirements.txt

Run Pyspark and Kafka in Jupyter Notebook

时光毁灭记忆、已成空白 提交于 2019-12-06 16:47:33
I could run this example in the terminal. My terminal command is: bin/spark-submit --packages org.apache.spark:spark-sql-kafka-0-10_2.11:2.3.0 examples/src/main/python/sql/streaming/structured_kafka_wordcount.py localhost:9092 subscribe test Now I wants to run it in Juypter python notebook. I tried to follow this (I could run the code in the link). But in my case, it failed. The following is my code: import os os.environ['PYSPARK_SUBMIT_ARGS'] = "--packages org.apache.spark:spark-sql-kafka-0-10_2.11:2.3.0 pyspark-shell" from pyspark.sql import SparkSession from pyspark.sql.functions import

ImportError: No module named data_utils

主宰稳场 提交于 2019-12-06 16:42:11
I'm extremely new to python and I'm recently trying to understand more about Machine Learning and Neural Nets I know this is a trivial question but I seem to be having problem importing data_utils on jupyter notebook. Can anyone please help Note: I am not using Keras, and I am following the tutorial in this video . Nikhil Yadav I was also following the video and went through the same issue, after searching for a while; Here is the link from Github tensorflow_chatbot_required_files . You can download from here and copy it to your working directory (python file directory). Now you will be able

No kernel for language json found - Hydrogen on atom

岁酱吖の 提交于 2019-12-06 16:35:00
I have found some people complaining about the python kernel but that is not my issue. Here is a print screen of the error , where you can see that when I try to run an ipynb file it gives me an error with the json kernel . The package is configure with default and I have the Python2 and Python3 kernels for Jupyter as you can see below. :~ jupyter kernelspec list --json { "kernelspecs": { "python2": { "spec": { "language": "python", "argv": [ "/usr/local/opt/python/bin/python2.7", "-m", "ipykernel", "-f", "{connection_file}" ], "display_name": "Python 2", "env": {} }, "resource_dir": "/usr

Getting DLL error with 'jupyter lab' command in Anaconda Installation

房东的猫 提交于 2019-12-06 15:24:47
Getting DLL error with 'jupyter lab' command in Anaconda Installation: Details for system: conda 4.5.11 Python 3.7.0 jupyter 4.4.0 Height of weirdness is that I am able to launch jupyter lab from Anaconda Navigator, but ' jupyter lab ' is not working and throwing below exception: Traceback (most recent call last): File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ML\installed_tools\anaconda3\Scripts\jupyter-lab.EXE\__main__.py",

Jupyter Notebook doesn't show new environments

你说的曾经没有我的故事 提交于 2019-12-06 15:08:05
问题 I have anaconda python 2.7 installed on my windows and I recently created a new environment for python 3.5 (using conda create -n py35 python=3.5 ). When I activate py35 and run jupyter notebook , it doesn't show py35 environment. It only has python root (py27). How can I use this environment by jupyter ? 回答1: To use jupyter notebook inside a virtual environment, ipykernal is required to be installed in your venv. Inside your virtual environment: pip install ipykernel Then run the kernel

How to switch to python 2.7 from python 3- jupyter notebook

狂风中的少年 提交于 2019-12-06 14:46:58
I am running a Jupyter notebook instance and it has both python 2 and python 3 kernels. However, when i use the python 2 kernel and execute below statements, import sys sys.executable I get python 3 path '/usr/bin/python3.4' How do i force it to use python 2.7 Re-installing Jupyter with pip instead of pip3 is what worked 来源: https://stackoverflow.com/questions/45106616/how-to-switch-to-python-2-7-from-python-3-jupyter-notebook

How to load image files dataset to TensorFlow Jupyter Notebook

徘徊边缘 提交于 2019-12-06 14:23:35
问题 I'm trying to create a model to classify some plants, just so I can learn how to use TensorFlow. The problem is that every good example that I can use as reference is loading a .csv dataset and I want to load a .jpeg dataset (could be .png or .jpg as well). Those examples even use a built in dataset like: from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) My dataset is organized in folders containing the label of the

IPython Notebook: Why do not appearing the widgets after installing correctly ipywidgets in DSX?

五迷三道 提交于 2019-12-06 13:49:28
After installing ipywidgets in a Jupiter notebook, DSX (IBM Datascience Experience framework), it doesn't show the widget, just a static stuff or A Jupyter Widget Example: import ipywidgets as widgets widgets.Dropdown( options = { 'One': 1, 'Two': 2, 'Three': 3 }, value = 2, description = 'Number:', ) Result: A Jupiter Widget I have tried several versions of !jupyter nbextension enable --py widgetsnbextension --sys-prefix based on http://ipywidgets.readthedocs.io/en/latest/user_install.html , but I still got the same error message: PermissionError: [Errno 13] Permission denied: '/usr/local/src

Interactive labeling of images in jupyter notebook

随声附和 提交于 2019-12-06 13:43:20
I have a list of pictures: pictures = {im1,im2,im3,im4,im5,im6} Where im1: im2: im3: im4: im5: im6: I want to assign the pictures to labels (1,2,3,4 etc.) For instance, here pictures 1 to 3 belong to label 1, picture 4 belongs to label 2, picture 5 to label 3, and picture 6 to label 4. -> label = {1,1,1,2,3,4} Since I need to see the images when I label them, I need a method to do that while labeling them. I was thinking of creating an array of images: And then I define the ranges by clicking on the first and last picture belonging to the same labels, so for example: What do you think ? Is