So I want to have a simplistic but fully featured ML setup
my specs:
https://www.pyimagesearch.com/2019/12/09/how-to-install-tensorflow-2-0-on-ubuntu/
(to lengthy / decided not to use gpu for teaching myself)
instead I used straightforward:
install Pycharm best by Ubuntu Softwarestore
Kernel->chang kernel->venv
To start jupyter:
To leave environment
deactivate
a good
my specs:
- needed python version
- conda instead of pip (as long as possible)
- linux os
- tensorflow
- keras
- jupyter notebooks
- pycharm IDE
(to lengthy / decided not to use gpu for teaching myself)
instead I used straightforward:
- https://www.tensorflow.org/install/
- tensorflow hello world (didn't get it running!)
- https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1_Introduction/helloworld.py
- following error apeared, couln't solve:
- sess = tf.Session()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'Session' - cpu tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
- https://keras.io/getting-started/sequential-model-guide/
- keras- hello world:
- https://gist.github.com/Orbifold/3f51f3c21d348873f4025813bfcf5614
- not to use python2.7 but python3.7
- to use pip instead of pip2
install Pycharm best by Ubuntu Softwarestore
- install python3
- pip install virtualenv # install virtual environments
- #for each projet: create environment
- mkdir project ; cd project
- python3 -m venv venv
- source venv/bin/activate
- pip install tensorflow
- pip install keras
- pip install ipykernel
- python -m ipykernel install --user --name=venv # install ipykernel
Kernel->chang kernel->venv
Keras has become a part of tensorflow. The book's code must be adapted:
replace
- import keras
by
- import tensorflow.keras as keras
Everything then should work fine.
Otherwise, you can replace each code of keras:
Access keras functionality through tensorflow:
instead of
instead of
- import keras
- model = keras.Sequential()
do
- import tensorflow as tf
- model = tf.keras.Sequential()
To start jupyter:
- jupyter notebook
To leave environment
deactivate
a good
Kommentare