google-colaboratory

How can we use microphone in google colab?

北城余情 提交于 2021-02-19 08:41:28
问题 OSError Traceback (most recent call last) <ipython-input-21-4159a88154c9> in <module>() 7 response = google_images_download.googleimagesdownload() 8 r = sr.Recognizer() ----> 9 with sr.Microphone() as source: 10 print("Say something!") 11 audio = r.listen(source) /usr/local/lib/python3.6/dist-packages/speech_recognition/ init .py in init (self, device_index, sample_rate, chunk_size) 84 assert 0 <= device_index < count, "Device index out of range ({} devices available; device index should be

Serving an Iframe in Google Colab Notebook: localhost refused to connect

核能气质少年 提交于 2021-02-19 04:19:16
问题 I am trying to serve some HTML from a Google Colab notebook using the following: from IPython.display import IFrame IFrame(src='./output/index.html', width=700, height=600) However, this throws localhost refused to connect : Does anyone know how I can serve the html in index.html (which must load javascript) inside the Colab notebook? Any pointers would be hugely appreciated! 回答1: You can serve content from the path /nbextensions/ which maps to /usr/local/share/jupyter/nbextensions . So you

how to add the path to PYTHONPATH in google colab

独自空忆成欢 提交于 2021-02-18 21:55:06
问题 how to execute the following command in google colab. export PYTHONPATH=/project/pylib/src:$PYTHONPATH !export PYTHONPATH=/project/pylib/src:$PYTHONPATH it is not affect. 回答1: Edit 2020-11-12 Using `%` instead of `!` retains any changes to all cells in the session. So, we can use that to set the environment variable `PYTHONPATH`. However, export doesn't work in colab. `%env` can be used to set the environment variable. ! echo $PYTHONPATH %env PYTHONPATH="$/env/python:/content/gdrive/My Drive

how to add the path to PYTHONPATH in google colab

為{幸葍}努か 提交于 2021-02-18 21:53:16
问题 how to execute the following command in google colab. export PYTHONPATH=/project/pylib/src:$PYTHONPATH !export PYTHONPATH=/project/pylib/src:$PYTHONPATH it is not affect. 回答1: Edit 2020-11-12 Using `%` instead of `!` retains any changes to all cells in the session. So, we can use that to set the environment variable `PYTHONPATH`. However, export doesn't work in colab. `%env` can be used to set the environment variable. ! echo $PYTHONPATH %env PYTHONPATH="$/env/python:/content/gdrive/My Drive

Google Colab - Where is the output saved?

佐手、 提交于 2021-02-18 16:33:18
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Google Colab - Where is the output saved?

久未见 提交于 2021-02-18 16:32:45
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Google Colab - Where is the output saved?

自闭症网瘾萝莉.ら 提交于 2021-02-18 16:31:52
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Why is import cntk as C not working in google colab

杀马特。学长 韩版系。学妹 提交于 2021-02-18 12:54:45
问题 I installed opencv version 3.4.4, installed cntk,Importing into google collab gives the following results. import cntk as C /usr/local/lib/python3.6/dist-packages/cntk/cntk_py_init.py:56: UserWarning: Unsupported Linux distribution (ubuntu-18.04). CNTK supports Ubuntu 16.04 and above, only. warnings.warn('Unsupported Linux distribution (%s-%s). CNTK supports Ubuntu 16.04 and above, only.' % (__my_distro__, __my_distro_ver__)) /usr/local/lib/python3.6/dist-packages/cntk/cntk_py_init.py:102:

Why isn't my colab notebook using the GPU?

与世无争的帅哥 提交于 2021-02-11 16:28:09
问题 When I run code on my colab notebook after having selected the GPU, I get a message saying "You are connected to a GPU runtime, but not utilizing the GPU". Now I understand similar questions have been asked before, but I still don't understand why. I am running PCA on a dataset over hundreds of iterations, for multiple trials. Without a GPU it takes about as long as it does on my laptop, which can be >12 hours, resulting in a time out on colab. Is colab's GPU restricted to machine learning

Can not load model weights saved to GCP with keras.save_weights. Need to transfer to new bucket to load weights

余生颓废 提交于 2021-02-11 15:36:00
问题 I am training on Google Colab with data and model weights loaded from/save to GCP. I am using Keras callbacks to save the weights to GCP. This is what the callback looks like callbacks = [tf.keras.callbacks.ModelCheckpoint(filepath='gs://mybucket/'+ 'savename' + '_loss_{loss:.2f}', monitor='loss', verbose=1, save_weights_only=True, save_freq='epoch')] The training saves the model weights successfully to my GCP bucket, but when I try to load those weights in a new session, the cell just hangs,