colabtools | Python libraries for Google Colaboratory | Machine Learning library
kandi X-RAY | colabtools Summary
Support
Quality
Security
License
Reuse
- Authenticate the service account
- Return True if the credentials are valid
- Return the path to adc json files
- Activate a service account key
- Authenticate the user
- Enable metrics server for GCE
- Enables the connection asynchronously
- Start the HTTP server
- Create a grid from row data
- Populate the widget
- Add an event listener
- Run a shell command
- Get output of a shell command
- Returns a JSON representation of the executed cells
- Remove an event listener
- Upload a single file
- Implements pip magic magic
- Run a shell command magic
- Run a shell cell magic
- Create a resource
- Get the memory usage of the kernel manager
- Compute metadata for the completions
- Return a JS representation of a table
- Completes a request
- Return the HTML representation of the element
- Format the data
colabtools Key Features
colabtools Examples and Code Snippets
Trending Discussions on colabtools
Trending Discussions on colabtools
QUESTION
I am using Google Colab through Safari (or Google Chrome) on an iPad.
I noticed I cannot cut, copy or paste code from one cell to another on this device. This does not happen on desktop-based operating systems.
This question addresses the same issue but is still unsolved and hasn't show any activity in a while. This GitHub issue addresses the problem too, but all the proposed solutions are workarounds.
Is there a way to fix this? Does anyone know if there's a browser where Colab works as expected?
ANSWER
Answered 2021-Sep-18 at 01:26It seems that the bug has been fixed as of 09-17-2021. I can now copy code from one cell to another in Safari on my iPad 8 running iOS 14.7.1.
In case someone needs it, here's the issue on GitHub.
QUESTION
Since GPU support with tensorflow-nightly is currently broken on Google Colab I'm trying to build my own docker image for development. However, when I install the object_detection
package from tensorflow/models
my nightly tensorflow package is overwritten by the version pulled in as a dependency from the object_detection
setup.py
.
I'm following essentially the same steps in Google Colab but my tensorflow nightly isn't overwritten there, so I'm not sure what I'm missing...
Here's my Dockerfile
:
FROM tensorflow/tensorflow:nightly-gpu-jupyter
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
RUN apt-get install -y \
curl \
git \
less \
zip
RUN curl -L -O https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip && unzip protoc-3.11.4-linux-x86_64.zip
RUN cp bin/protoc /usr/local/bin
RUN git clone --depth 1 https://github.com/tensorflow/models
RUN cd models/research && \
protoc object_detection/protos/*.proto --python_out=. && \
cp object_detection/packages/tf2/setup.py . && \
python -m pip install .
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
which I'm building with:
docker pull tensorflow/tensorflow:nightly-gpu-jupyter
docker build --no-cache . -f models-tf-nightly.Dockerfile -t tf-nightly-models
The first print()
shows:
Tensorflow version: 2.5.0-dev20201129
but the second one shows:
Tensorflow version: 2.3.1
In Google Colab I'm doing essentially the same steps:
# Install the Object Detection API
%%bash
pip install tf-nightly-gpu
[[ -d models ]] || git clone --depth 1 https://github.com/tensorflow/models
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
After which
import tensorflow as tf
print(tf.__version__)
prints 2.5.0-dev20201201
So somehow my Google Colab steps are preserving my nightly Tensorflow install, whereas on Docker it gets overwritten with 2.3.0.
ANSWER
Answered 2020-Dec-02 at 22:19If you look at pip list
before installing the object detection package, you will see that tf-nightly-gpu
is installed but tensorflow
is not. When you install the object detection package, the tensorflow
package is pulled in as a dependency. pip
thinks it is not installed, so it installs it.
One way around this is to trick pip install thinking that the tensorflow
package is installed. One can do this by symlinking the tf_nightly_gpu-VERSION.dist-info
directory in dist-packages
. I have added the lines to do this in the Dockerfile below. At the bottom of this post, I have also included a Dockerfile which implements some best practices to minimize image size.
FROM tensorflow/tensorflow:nightly-gpu-jupyter
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
RUN apt-get install -y \
curl \
git \
less \
zip
# Trick pip into thinking that the 'tensorflow' package is installed.
# Installing `object_detection` attempts to install the 'tensorflow' package.
# Name the symlink with the suffix from tf_nightly_gpu.
WORKDIR /usr/local/lib/python3.6/dist-packages
RUN ln -s tf_nightly_gpu-* tensorflow-$(ls -d1 tf_nightly_gpu* | sed 's/tf_nightly_gpu-\(.*\)/\1/')
WORKDIR /tf
RUN curl -L -O https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip && unzip protoc-3.11.4-linux-x86_64.zip
RUN cp bin/protoc /usr/local/bin
RUN git clone --depth 1 https://github.com/tensorflow/models
RUN cd models/research && \
protoc object_detection/protos/*.proto --python_out=. && \
cp object_detection/packages/tf2/setup.py . && \
python -m pip install .
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
Here is a Dockerfile that leads to a slightly smaller image (0.22 GB uncompressed). Notable changes are clearing the apt
lists and using --no-cache-dir
in pip install
.
FROM tensorflow/tensorflow:nightly-gpu-jupyter
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
RUN apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
less \
zip && \
rm -rf /var/lib/apt/lists/*
# Trick pip into thinking that the 'tensorflow' package is installed.
# Installing `object_detection` attempts to install the 'tensorflow' package.
# Name the symlink with the suffix from tf_nightly_gpu.
WORKDIR /usr/local/lib/python3.6/dist-packages
RUN ln -s tf_nightly_gpu-* tensorflow-$(ls -d1 tf_nightly_gpu* | sed 's/tf_nightly_gpu-\(.*\)/\1/')
WORKDIR /tf
RUN curl -L -O https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip && \
unzip protoc-3.11.4-linux-x86_64.zip && \
cp bin/protoc /usr/local/bin && \
rm -r protoc-3.11.4-linux-x86_64.zip bin/
# Upgrade pip.
RUN python -m pip install --no-cache-dir --upgrade pip
RUN git clone --depth 1 https://github.com/tensorflow/models
WORKDIR models/research
RUN protoc object_detection/protos/*.proto --python_out=. && \
cp object_detection/packages/tf2/setup.py . && \
python -m pip install --no-cache-dir .
RUN python -c "import tensorflow as tf; print(f'Tensorflow version: {tf.__version__}')"
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install colabtools
You can use colabtools like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page