No module named 'rnn_utils'

1,298 views
Skip to first unread message

xtian2...@gmail.com

unread,
Jun 20, 2018, 2:36:09 PM6/20/18
to Keras-users
I was using jupyter notebook, running utitled.ipynb, and wrote: from rnn_utils import *.
But it gives me an error that "no module named 'rnn_utils'.
I installed the keras and jupyter notebook in conda environment.
Can anyone help me out? Thanks!

Matias Valdenegro

unread,
Jun 20, 2018, 2:45:36 PM6/20/18
to keras...@googlegroups.com

Hello,

 

rnn_utils is not part of Keras, so I am not sure why you are asking here. What exactly are you trying to do?

> <https://lh3.googleusercontent.com/-G-uhcSeVUr8/WyqeKm_KKAI/AAAAAAAAAAM/nAI_

> PKYqQmY9K5Jhh4ev6Kb_C7xt-YAQgCLcBGAs/s1600/Screen%2BShot%2B2018-06-20%2Bat%2

> B2.33.41%2BPM.png>

> <https://lh3.googleusercontent.com/-G-uhcSeVUr8/WyqeKm_KKAI/AAAAAAAAAAM/nAI

> _PKYqQmY9K5Jhh4ev6Kb_C7xt-YAQgCLcBGAs/s1600/Screen%2BShot%2B2018-06-20%2Bat%

> 2B2.33.41%2BPM.png>

 

 

Xin Tian

unread,
Jun 20, 2018, 2:54:13 PM6/20/18
to Matias Valdenegro, keras...@googlegroups.com
hello,
thanks for replying
I want to implement a programming exercise about building RNN step by step in Andrew Ng's deep learning course in my own jupyter notebook instead of the course's notebook.
here is part of the code:
import numpy as np
from rnn_utils import *
def rnn_cell_forward(xt, a_prev, parameters):
def rnn_forward(x, a0, parameters):
...
this code is provided by the course, but I want to implement on my own. 

--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/1905880.CW2hl8oSS0%40vsd-grey-wolf.

For more options, visit https://groups.google.com/d/optout.



--
Xin Tian
Ph.D student
Graduate Teaching Assistant
Department of Electrical and Computer Engineering
University of Maryland
College Park
MD-20740, USA

Xin Tian

unread,
Jun 20, 2018, 2:55:47 PM6/20/18
to Matias Valdenegro, keras...@googlegroups.com
and I think this problem is similar to this one i met in keras
here is the code
from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply
from keras.layers import RepeatVector, Dense, Activation, Lambda
from keras.optimizers import Adam
from keras.utils import to_categorical
from keras.models import load_model, Model
import keras.backend as K
import numpy as np

from faker import Faker
import random
from tqdm import tqdm
from babel.dates import format_date
from nmt_utils import *
import matplotlib.pyplot as plt
%matplotlib inline

when I run this,
I got no module named nmt_utils

Dennis S

unread,
Jun 20, 2018, 2:55:51 PM6/20/18
to Xin Tian, Matias Valdenegro, keras...@googlegroups.com
It sounds like you need to do just a little more work in setting up your python environment. You need to add this library to the environment that contains this notebook. 

Thanks

Dennis
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/CADqPZ_FZ0_MUbRRH_oaty92ig3a5Lr5oBGSNswMTJmNec4Y5sw%40mail.gmail.com.

tianxin...@gmail.com

unread,
Jun 21, 2018, 9:29:46 AM6/21/18
to Keras-users
Thanks! But i didn’t find the package named nmt.util.
Still need more suggestions, thanks!

Matias Valdenegro

unread,
Jun 21, 2018, 9:43:48 AM6/21/18
to keras...@googlegroups.com

Your problem has nothing to do with Keras, please stop asking here.

deepen...@gmail.com

unread,
Jul 19, 2020, 10:58:52 AM7/19/20
to Keras-users

Hi,
 
       You have to download this file and put it on the working directory. It works for me.
https://github.com/Kulbear/deep-learning-coursera/blob/master/Sequence%20Models/rnn_utils.py
To unsubscribe from this group and stop receiving emails from it, send an email to keras...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages