Stuck at do you want to continue on jupyter notebook - tensorflow

First off I am using Linux operating system.
The problem is that I am stuck at "Do you want to continue [Y/n]". This will not allow me to download the remaining files because I am having trouble figuring out how to insert a "y" to continue downloading the files.
Here is a snippet of the code where I think the problem lays:
if os.name=='posix':
!apt-get install protobuf-compiler
!cd Tensorflow/models/research && protoc object_detection/protos/*.proto --python_out=. && cp object_detection/packages/tf2/setup.py . && python -m pip install .
The output that appears is this:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
systemd-hwe-hwdb
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libprotobuf-dev libprotobuf-lite23 libprotoc23
Suggested packages:
protobuf-mode-el
The following NEW packages will be installed:
libprotobuf-dev libprotobuf-lite23 libprotoc23 protobuf-compiler
0 upgraded, 4 newly installed, 0 to remove and 96 not upgraded.
Need to get 2,246 kB of archives.
After this operation, 14.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Here we can see that I am stuck at Do you want to continue [Y/n].
The first thing I tried was running jupyter notbook as a root user which helped for a little until I reached this part.
The second thing I tried was adding a "y" underneath the snippet of the code in jupyter notebook hoping that it will continue downloading the files.

I figured it out it was missing something after doing some research.
If anyone is stuck here please change your code to something like this:
!yes | apt-get install
protobuf-compiler

Related

Tensorflow-Text in Miniconda

I am trying to install tensorflow-text through miniconda in Spyder. I have managed to install other modules in Spyder such as tensorflow itself, pandas, scikit-learn, etc. However, using the same command as all the other installations (with the specific package name replaced by tensorflow-text)
conda install spyder-kernels tensorflow-text -y
I continue to get the same error whenever I try to install tensorflow-text:
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-text
followed by a suggestion to search for the package on anaconda.org. As such, I searched for the tensorflow-text package on the anaconda site and found one, albeit for linux, by rocketce. Attempting to run the commands listed under the tensorflow-text installation instructions on that webpage also yielded the same error.
At first, I tried to install tensorflow-text through pip and was able to successfully run the command
pip install -U tensorflow-text==2.10.0
which seemed to install tensorflow-text. But I could not figure out how to access it or if it was correctly installed. Specifically, I am looking to use tensorflow-text in the Spyder IDE. I was able to get tensorflow working in the IDE, but not the specific tensorflow-text.
I am using a Windows 10 system; I could not find anything on the anaconda site for Windows 10. I am rather inexperienced (if you could not already tell from the nature and description of the problem), so patience and clear explanations are appreciated. Thanks in advance!

doc_controls has not attribute 'inheritable headers'

I'm starting this thread with an answer, not a question. The questions are stated at the end:
I tried to add pip package 'tfx' to Apache Airflow using my own Dockerfile and docker-compose.yaml. I added my own DAG to Airflow and that failed to load with this error message:
doc_controls has not attribute 'inheritable_header'
It cost me only a day to find the cause. When you add this to your Dockerfile..
pip install tfx
..pip will install txf, tensorflow-2.6.0 and tensorflow-estimator-2.7.0. The latter is apparently depending on the not-yet-released code in the github repo tensorflow/docs which contains doc_controls.
So instead add this to keep tensorflow-estimator in line with packages that pip can find:
RUN pip install --no-cache-dir --user \
tfx==1.3.1 \
tensorflow==2.6.0 \
tensorflow-estimator==2.6.0
I'm loosing a lot of time solving problems with dependencies between pip packages and pip packages and the underlying C/C++ libraries. Am I the only one?
Here are my questions:
Am I correct to assume that pip is supposed to figure out which versions of dependencies of tfx to install. Should I normally be able to rely on pip to do this correctly or will pip simply install the latest version of all dependencies without regard to their mutual compatibility?
On the internet there are many Dockerfile around that do not specify any version numbers of the apt/pip packages to install. Such a Dockerfile is like a box of chocolates right? If you build the dockerfile a time t1 and at time t2 then their contents can differ in terms of versions right?
In general: Given a docker image why can one not get the Dockerfile that was used to construct the docker image?
Regards,
Chris
I also keep running into these dependency issues recently. I came across another post which might be of interest: Resolving new pip backtracking runtime issue. Based off this I think pip does try to figure out what versions of packages to install to avoid conflicts but I guess it sometimes struggles. I tried one of the tools, pipreqs but I didn't find it useful for my particular problem. In fact it broke things even more.
Also thanks for the solution to this one, I had the same problem.

How do I get the man command?

I just installed Windows Subsystem for Linux for the first time and downloaded the Debian distribution from the Windows Store.
The first thing I tried to do was use the "mv" command. The second thing was to run "man mv" because I don't remember how to use it. But I received the error:
-bash: man: command not found
It looks like the package I want is called manpages. But I can't install that:
sudo apt-get install manpages
[sudo] password for pi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package manpages is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'manpages' has no installation candidate
How do I get the man command up and running?
apt update to update the local package lists followed by apt install man-db to install the actual package.
I want to add to elken's answer that apparently, the 'man-db' packages doesn't cover all the manpages. For example, I needed documentation for the C stdio library (fopen, fgets, ...), and for that I had to install 'manpages-dev':
sudo apt install manpages-dev
Apparently there are also some other manpage collections (/different names for them on certain unix distros), see https://superuser.com/questions/40609/how-to-install-man-pages-for-c-standard-library-functions-in-ubuntu

Can you use rmagic (rpy2) in google colaboratory?

I know google colaboratory doesn't yet support an R kernel. What about rmagic? Can I use rpy2?
I tried :
!pip install rpy2==2.8.6
And got :
Collecting rpy2==2.8.6
Using cached https://files.pythonhosted.org/packages/32/54/d102eec14f9cabd0df60682a38bd45c36169a1ec8fb8a690bf436cb6d758/rpy2-2.8.6.tar.gz
Complete output from command python setup.py egg_info:
Error: Tried to guess R's HOME but no command 'R' in the PATH.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3bSiiD/rpy2/
I'm guessing that it isn't working because R isn't installed on whatever cloud machine this notebook is running on, and that it probably isn't possible to install it. But I'm hoping I'm wrong and someone may know of a work around.
OK, I answered my own question. I thought for sure this would fail, but tried anyway:
!apt-get update
!apt-get install r-base
!pip install rpy2==2.8.6
And it worked!

Tensorflow with gpu support installation error - the specified --crosstool_top is not a valid cc_toolchain_suite rule

I've been trying to install tensorflow with GPU support using these steps:
http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.html
and also using:
http://thelazylog.com/install-tensorflow-with-gpu-support-on-sandbox-redhat/
This is the error message that I'm getting when I try to run the bazel build command for building the tensorflow pip package (with the --config-cuda flag set):
The specified --crosstool_top '//third_party/gpus/crosstool:crosstool' is not a valid cc_toolchain_suite rule.
What's strange is that if i remove the --config=cuda flag, I don't get the error message while building and I'm able to install tensorflow successfully - but without GPU support.
I experienced the same issue, using the nvidia instructions. What I did was to drop the git reset line in the instructions, and it works.
Details (from the error message):
Close, reopen terminal
Run git clone (again), and cd tensorflow
Run ./configure
Bazel build, etc
This may be unrelated, but I experienced an issue with the .whl line, the error message was that the wheel cannot be found or something along those lines. This is the "And finally install the TensorFlow pip package" section. To resolve it in my case, I typed in the terminal all the way to "..._pkg/tensorflow", and then pressed tab for auto-completion. The file name that popped up was significantly longer than that in the guide, but it worked. Also, if anyone face a numpy not installed message based on the nvidia instructions, replace the python-pip and dev with python-numpy and run that line again to install.
Configuration: Fresh Ubuntu 16.04, GTX970M, running driver 367.48 (from CUDA installation), CUDA 8.0, CuDNN 5.1
Full setup path:
Fresh Ubuntu, with downloads and 3rd party apps selected during installation.
Control panel => Software and updates => Other Software => Canonical ticked
Install CUDA using nvidia instructions in CUDA documentation, .deb format
CuDNN 5.1 installed, the rest from the nvidia link.
I hope everything works out for you!
(I'm sorry for the poor formatting)
I was going through same problem and recently found the solution. The problem is with the installation of Bazel which leads to this kind of error.
After installation of bazel from installer, make sure that you would give the correct path to ~./bashrc and also activate the path using
source "path-to-your-bin-directory-for-bazel"
Please change the git source version slightly as shown below
$ git clone https://github.com/tensorflow/tensorflow
$ cd tensorflow
// $ git reset --hard 70de76e
$ git reset --hard 287db3a
And please refer the below l
https://github.com/tensorflow/tensorflow/issues/4944
Also, zlib has been updated since this TF build. You need to check http://www.zlib.net/ to get the latest version and SHA-256, then update tensorflow/workspace.bzl with that information (lines 254-266 in this build). At this time, the correct version info would include the following:
url = "http://zlib.net/zlib-1.2.11.tar.gz",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",