Tensorflow not working on Python 3.7, Mac OS, and Pycharm - tensorflow

Attempting to run tensorflow a Mac, using python 3.7 as well as PyCharm and receiving where module tensorflow has no attribute app, at the following.
I've run through a number of potential solutions. Following the instructions provided on this question: Installing tensorflow on Pycharm (Mac). I've managed to successfully create a virtual-env in which I installed the tensorflow package however this folder contains
nothing but the init.py and pycache and the error remains.
I've also tried copying the contents of the tensorflow GitHub repo directly into this folder but it results in an ImportError.
Not sure what the issue is. Should I switch to python 2.7?

Python 3.7 is still unsupported as of this moment by tensorflow.

Related

Cannot import Tensorflow

I can't import tensorflow, even after checking all dependencies. I'm getting an error message 'ModuleNotFoundError: No module named 'tensorflow'' when importing 'import tensorflow as tf' in vs code
I installed tensorflow through conda with 'conda install tensorflow'. It seems to have worked, since when I use 'pip show tensorflow', it shows up as 'version 2.10.0'. Moreover, my Python version is '3.9.15', so it should be compatible. I've been looking all over and no other installatoins have been working. Any suggestions?
Please try again by using Python version 3.10 as Python 3.9 shows some version errors in VS code.
Please check this link to install TensorFlow in VScode.

Are there problems with Tensorflow and Keras in Mac version 12.2 (OS Monterey)

I bought a new Mac version 12.2 (OS Monterey) and installed Anaconda. Most of the Python packages can be installed correctly. However, Tensorflow (ver 2.8.0) and Keras (ver 2.8.0) have major issues. The Jupyter notebook kernel gets killed when tensorflow and/or keras get imported. I looked up various posts on Stackoverflow and Medium, however, nothing seems helpful. I even tried to convert the .ipynb to .py script, however, the same error occurs.
Is there anything that can be done to resolve this?

Problem with importing tensorflow and testing NN

I'm currently working on a program to play a game similar to atari-games. I'm using keras (python 3). I finished writing the code and I want to test it, and I have few questions about the process:
first of all, I have trouble importing tesnorflow for some reason. I've installed it using pip. I've made sure to created new env. before the installation (which finished successfully), but when I try to run my program it says:
ModuleNotFoundError: No module named 'tensorflow'
I also, tried to install the package from within pycharm, but then I get this error:
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
I've checked program requirements (such as pip, python, virtualenv and setuptools versions) and everything seems up to date. perhaps someone could point out what else might be the problem?
Is there any other way I can test the performance of my program?
Thank you very much for your time and attention.
Anaconda is a complete time-saver. I suggest create an enviornment using Anaconda and install the tensorflow by conda install tensorflow If you would like to use the gpu version, conda automatically installs the CUDA and cudnn for you too.

Is it possible to compile tensorflow in Mac?

So I started to build tensorflow in Mac and the thing is that it doesn't seem possible to build tensorflow in Mac OS platform.
After following instructions in here, I get this package directory.
It seems like the build settings for bazel is only for linux distro. The reason why I thought so is because there is a .so file in package directory that is needed to be linked after importing tensorflow using python binary.
This is the result I get after importing tensorflow using python.
Is there any other way I can build tensorflow on Mac OS?
It seems like there are no options but to install tensorflow with pip. So I just created a new virtual machine and installed ubuntu 16.04 to use it as my docker host. By doing so, I can create a new docker container which can now link and execute the linux library.

Tensorflow installation

Upon trying to install Tensorflow for conda environment, I encountered with the following error message, without any progress:
tensorflow-1.1.0-cp35-cp35mwin_amd64.whl is not a supported wheel on this platform
Have you tried uninstalling and re-installing TensorFlow using pip within your Conda environment? I.e.:
pip uninstall tensorflow
Followed by:
pip install tensorflow
If it doesn't work, the issue may be with your Python installation. TensorFlow only supports 64-bit Python 3.5+ on Windows (see more info here).
Perhaps you have Python's default installation, which comes in a 32-bit version. If that's the case, you can download the 64-bit Python 3.5 or later from here to run in your Conda environment and then you should be able to install/run TensorFlow without any issues.
Make sure that the Python version installed in the Environment is 3.5 not 3.6. Since 3.6 was released Conda automatically sets that version as default for python 3. However, it is still not supported by Tensorflow.
You can work using tensorflow library along with other essential libraries using the Dockerfile. Using Docker for environment are a good way to run experiments in reproducible manner as in this blog
You can also try using datmo in order setup environment and track machine learning projects for making it reproducible using datmo CLI tool.