2
votes

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

enter image description here

Note: I am not using Keras, and I am following the tutorial in this video.

6
Please don't use links, copy and paste your code and the error into your question. Does the module load using a command-line program? - cdarke
Can you show the rest of the program? it could tell us which packages you'd need to install (e.g. is your program using keras or tflearn?) - bakkal
This question seems to be already answered here: stackoverflow.com/questions/35905264/… - Diego
I'm not using Keras, I'm not sure about tflearn. I'm just using powershell to open tensorflow in jupyter notebook with docker. I'm just attempting to follow a tutorial on youtube. Haven't got as far yet - Lee

6 Answers

2
votes

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 to import both.

1
votes

Based on the link that you provided for the video you are using, go to this link and download both files into your working directory.

The files you need to download are data_utils and seq2seq_model.

But before doing this tutorial try the tensorflow tutorials found on the tensorflow website, to get you started with this library.

Also, if you are very new to python, I recommend this tutorial first.

0
votes

Since you mentioned about Machine Learning and Neural Nets, I'll assume you're referring to Keras.

I'll also assume that you installed it via

pip install keras

In that case, you need to uninstall it first by running

pip uninstall keras

Then, clone it from Github, cd into its directory and run

sudo python setup.py install

More information here

0
votes

I'm assuming you are using code from tensorflow's github, in that case you need to download https://github.com/tensorflow/models/blob/master/tutorials/rnn/translate/data_utils.py into your folder also.

0
votes

what you are trying to do is importing a self-defined module, in order to do that do as follow:

in your case the module is called 'data_util' which contains functions that will be called later as data_util.'function name'.

let say that the data_util which is a python file (.py) is in this directory (C:/Users/xxx/modules), so all what you have to do is to run this line of code in order for python to find your modul when you call import data_util:

import sys  
sys.path.append('C:/Users/xxx/modules')  
import data_util
0
votes

I too was using same files. Just open seq2seq_model.py and in line 35 remove from TensorFlow and keep it just import dat_