Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: Open utils.py and fill with your code. In case of Google Colab, download(https://github.com/hse-aml/natural-language-processing/blob/master/project/utils.py), edit locally and upload using '> arrow on the left edge' -> Files -> UPLOAD #27

Open
ayushmandloi2 opened this issue Oct 7, 2018 · 28 comments

Comments

@ayushmandloi2
Copy link

No description provided.

@ayushmandloi2 ayushmandloi2 changed the title NotImplementedError: Open utils.py and fill with your code. In case of Google Colab, download(https://github.com/hse-aml/natural-language-processing/blob/master/project/utils.py), edit locally and upload using '> arrow on the left edge' -> Files -> UPLOAD NotImplementedError: Open utils.py and fill with your code. In case of Google Colab, download(https://github.com/hse-aml/natural-language-processing/blob/master/project/utils.py), edit locally and upload using '> arrow on the left edge' -> Files -> UPLOAD Oct 7, 2018
@ayushmandloi2
Copy link
Author

i have edited and uploaded the utils.py file.
coursera

@ZEMUSHKA
Copy link
Collaborator

ZEMUSHKA commented Oct 7, 2018

Try running ! shred utils.py and re-upload your file! It looks like a caching bug in Google Colab.

@ZEMUSHKA
Copy link
Collaborator

ZEMUSHKA commented Oct 7, 2018

And you also need to restart the kernel to import the new version of the file!

@ayushmandloi2
Copy link
Author

issue not solved yet i tried what you told.
coursera2

@ayushmandloi2
Copy link
Author

coursera3
coursera4

@ayushmandloi2
Copy link
Author

this is my utils.py file i have implemented what is said

@ZEMUSHKA
Copy link
Collaborator

ZEMUSHKA commented Oct 7, 2018

Then it's a Google Colab issue, try to run locally

@ablabedoui
Copy link

ablabedoui commented Oct 11, 2018

err

Please I don't understand this error can help me !!

@ayushmandloi2
Copy link
Author

still the problem not solved i tried running it locally and getting same error what i got in google colab. What exactly we have to do with word_embeddings.tsv file because i don't have this file. Should we download it from some where or code will automatically download it.

@ayushmandloi2
Copy link
Author

please explain me what we have to do in Part-2 Ranking question with embeddings?

@fahadshery
Copy link

having the same error on both colab and on the local docker container

@sushantdecode
Copy link

Same error.
Do we have any solution for this?

@Wong-Vee-Kin
Copy link

Was stuck here for a while. Eventually i just copied the load_embeddings code into the cell.

@danielunifim55
Copy link

Anyone could solve that problem? I am stuck there right now

@libindavis
Copy link

I directly copy the function of load_embeddings and question_to_vec to the .ipynb to work around this issue.
I believe it is an Google Colab bug.

@Puru-Malhotra
Copy link

I directly copy the function of load_embeddings and question_to_vec to the .ipynb to work around this issue.
I believe it is an Google Colab bug.

can you please drop the code snippet for load_embeddings and question_to_vec

@rthirumurugan2000
Copy link

I'm also facing the same problem,stuck in it for a while!

@nikhilrana015
Copy link

Facing the Same Issue. Anyone got any solution to it

@SanjanaNaidu
Copy link

NotImplementedError Traceback (most recent call last)
in ()
----> 1 embeddings, embeddings_dim = load_embeddings('data/word_embeddings.tsv')

/content/utils.py in load_embeddings(embeddings_path)
53 embeddings[word]=embedding
54 dim=len(line)-1
---> 55 return embeddings,dim
56
57 def question_to_vec(question, embeddings, dim):

NotImplementedError: Open utils.py and fill with your code. In case of Google Colab, download(https://github.com/hse-aml/natural-language-processing/blob/master/project/utils.py), edit locally and upload using '> arrow on the left edge' -> Files -> UPLOAD

can someone solve this

@SanjanaNaidu
Copy link

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

File "", line unknown
SyntaxError: invalid or missing encoding declaration for '/content/utils.py'

@SanjanaNaidu
Copy link

whats wrong with mine I followed all the steps but getting the above errors 😭😭😭😭😭😭😭😭😭

@nikhilrana015
Copy link

@SanjanaNaidu
1.> First try to restart the kernel. If it does not work then try the second way.
2.>when you update the script file and upload it in your project directory. Give the file another name like utils-2.py. delete the previous util.py file and rename the uploaded utils-2.py file as the same name utils.py.

@SanjanaNaidu
Copy link

SanjanaNaidu commented May 30, 2020 via email

@SanjanaNaidu
Copy link

SanjanaNaidu commented Jun 1, 2020 via email

@SanjanaNaidu
Copy link

SanjanaNaidu commented Jun 1, 2020 via email

@MariBax
Copy link
Contributor

MariBax commented Jun 3, 2020

There are two ways:

  1. Short workaround: just directly copy functions load_embeddings and question_to_vec to .ipynb.
  2. Do the following steps:
  • remove utils.py with !rm utils.py
  • upload your file: click at [>] to open the left pane, choose file tab, click [upload] and choose your [utils.py]
  • restart runtime: Runtime --> Restart runtime
  • import: from utils import *

@superzerg
Copy link

Here is a way to not have to restart runtime:
replace the cell
from utils import text_prepare
by:

from importlib import reload  
reload(sys.modules['utils'])
from utils import text_prepare

and rerun it. That's all !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests