ImportError: No module named data_utils

主宰稳场 提交于 2019-12-06 16:42:11
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 to import both.

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.

ooknosi

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

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.

Oussama Errabia

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
Rishabh Mishra

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!