google-colaboratory

Jupyter / Colab : Play sound with any error in any cell + Play sound after completing long running cells

隐身守侯 提交于 2020-07-03 09:35:20
问题 Sometimes an error happens but I don't notice because I may be running multiple cells at one. I'd like errors to play a sound. Many people would like long running cells to play a sound when completed. 回答1: I mixed the solutions I found in some places 1 2 3 4 a) Create a global exception handler that beeps on errors b) Create a simple function that you place at the end of the long-running cell (some other approaches on links) You can change the sounds to anything you like. Note: The sounds

Tensorflow raised error: ImportError: cannot import name 'export_saved_model'

自作多情 提交于 2020-07-03 04:02:28
问题 seems like "import tensorflow as tf" directly raise this error Colab link:https://colab.research.google.com/drive/1Jr0j_I_npKQxcQ1ggJQFHTqoJHmt9Bqk 回答1: sorry, the problem is that installing tensorflow-gpu does not uninstall tensorflow and tensorflow 2.2.0 has introduced some changes that are incompatible with tensorflow 1.14.0. if you do %tensorflow_version 2.x !pip uninstall -y tensorflow !pip install tensorflow-gpu==1.14.0 it will work 来源: https://stackoverflow.com/questions/60879608

Tensorflow raised error: ImportError: cannot import name 'export_saved_model'

谁说我不能喝 提交于 2020-07-03 04:00:05
问题 seems like "import tensorflow as tf" directly raise this error Colab link:https://colab.research.google.com/drive/1Jr0j_I_npKQxcQ1ggJQFHTqoJHmt9Bqk 回答1: sorry, the problem is that installing tensorflow-gpu does not uninstall tensorflow and tensorflow 2.2.0 has introduced some changes that are incompatible with tensorflow 1.14.0. if you do %tensorflow_version 2.x !pip uninstall -y tensorflow !pip install tensorflow-gpu==1.14.0 it will work 来源: https://stackoverflow.com/questions/60879608

FileNotFoundError: No such file: -> Error occuring due to TimeOut of Google Drive?

泪湿孤枕 提交于 2020-07-02 02:49:50
问题 I created a DataGenerator with Sequence class. import tensorflow.keras as keras from skimage.io import imread from skimage.transform import resize import numpy as np import math from tensorflow.keras.utils import Sequence Here, `x_set` is list of path to the images and `y_set` are the associated classes. class DataGenerator(Sequence): def __init__(self, x_set, y_set, batch_size): self.x, self.y = x_set, y_set self.batch_size = batch_size def __len__(self): return math.ceil(len(self.x) / self

FileNotFoundError: No such file: -> Error occuring due to TimeOut of Google Drive?

China☆狼群 提交于 2020-07-02 02:49:11
问题 I created a DataGenerator with Sequence class. import tensorflow.keras as keras from skimage.io import imread from skimage.transform import resize import numpy as np import math from tensorflow.keras.utils import Sequence Here, `x_set` is list of path to the images and `y_set` are the associated classes. class DataGenerator(Sequence): def __init__(self, x_set, y_set, batch_size): self.x, self.y = x_set, y_set self.batch_size = batch_size def __len__(self): return math.ceil(len(self.x) / self

How to share Google colab with private code

廉价感情. 提交于 2020-06-27 17:04:15
问题 I am wanting to share a Google colab notebook, but needs to hide part of the code. Is it possible to put the private code in a separate .py or Colab notebook, and import it, so that those who have access to the public Colab notebook cannot see the private .py or Colab notebook? Many thanks in advance. 回答1: Not really; your ability to hide code is only as good as your users' inability to inspect it: import some_file # your private .py from inspect import getsource print(getsource(some_file))

How to share Google colab with private code

Deadly 提交于 2020-06-27 17:03:56
问题 I am wanting to share a Google colab notebook, but needs to hide part of the code. Is it possible to put the private code in a separate .py or Colab notebook, and import it, so that those who have access to the public Colab notebook cannot see the private .py or Colab notebook? Many thanks in advance. 回答1: Not really; your ability to hide code is only as good as your users' inability to inspect it: import some_file # your private .py from inspect import getsource print(getsource(some_file))

How to import CSS file into Google Colab notebook (Python3)

跟風遠走 提交于 2020-06-27 12:17:23
问题 I am working on a Python 3 notebook in Google Colab. I would like to use a CSS file to change the header styles (color, font, etc.) and change numbered sub-lists to alphabetical. I need help importing the CSS into a Colab notebook. Here is the Markdown code: # List 1. item 1. item 1. item 1. sub-item 1. sub-item 1. sub-item It renders as: List item item item sub-item sub-item sub-item Here's the CSS: ol ol { list-style-type: lower-roman; } h1 { color: red; } I want it to render as: List

Pandas style doesn't work with Google colab

瘦欲@ 提交于 2020-06-27 10:22:27
问题 I'm facing a strange behavior with Google colab and pandas style. When applying a style to a dataframe on google colab, some of the basic styling is messed up: the table becomes smaller and more condensed, the highlight of every other row disappears, and the hover highlight of rows stops working. I'm attaching a side-by-side picture of two screenshots: one from a regular Jupiter notebook, in which things are working fine, and another one from Google colab - in which styling messes up things.

How to install nvidia apex on Google Colab

时光总嘲笑我的痴心妄想 提交于 2020-06-27 09:03:27
问题 what I did is follow the instruction on the official github site !git clone https://github.com/NVIDIA/apex !cd apex !pip install -v --no-cache-dir ./ it gives me the error: ERROR: Directory './' is not installable. Neither 'setup.py' nor 'pyproject.toml' found. Exception information: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 178, in main status = self.run(options, args) File "/usr/local/lib/python3.6/dist-packages