lukas / ml-class Goto Github PK
View Code? Open in Web Editor NEWMachine learning lessons and teaching projects designed for engineers
Home Page: https://www.youtube.com/channel/UCBp3w4DCEC64FZr4k9ROxig
License: GNU General Public License v2.0
Machine learning lessons and teaching projects designed for engineers
Home Page: https://www.youtube.com/channel/UCBp3w4DCEC64FZr4k9ROxig
License: GNU General Public License v2.0
pip install -r requirements.txt
wandb signup
how to solve traceback error help me , all log is given
pip install -r requirements.txt
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tensorflow in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: keras in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 2)) (2.3.1)
Requirement already satisfied: pandas in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 3)) (0.24.2)
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from -r requirements.txt (line 4)) (1.8.0rc1)
Requirement already satisfied: pillow in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 5)) (6.2.2)
Requirement already satisfied: wandb in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 6)) (0.8.22)
Requirement already satisfied: h5py in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 7)) (2.10.0)
Requirement already satisfied: opencv-python in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 8)) (4.1.2.30)
Requirement already satisfied: scikit-learn in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 9)) (0.20.4)
Requirement already satisfied: scikit-image in /Users/survar/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 10)) (0.14.5)
Requirement already satisfied: protobuf>=3.8.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (3.11.2)
Requirement already satisfied: enum34>=1.1.6; python_version < "3.4" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from tensorflow->-r requirements.txt (line 1)) (1.1.6)
Requirement already satisfied: absl-py>=0.7.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (0.9.0)
Requirement already satisfied: functools32>=3.2.3; python_version < "3" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (3.2.3.post2)
Requirement already satisfied: gast==0.2.2 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (0.2.2)
Requirement already satisfied: wheel; python_version < "3" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from tensorflow->-r requirements.txt (line 1)) (0.33.1)
Requirement already satisfied: six>=1.12.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from tensorflow->-r requirements.txt (line 1)) (1.12.0)
Requirement already satisfied: termcolor>=1.1.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.1.0)
Requirement already satisfied: keras-applications>=1.0.8 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.0.8)
Requirement already satisfied: astor>=0.6.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (0.8.1)
Requirement already satisfied: mock>=2.0.0; python_version < "3" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (3.0.5)
Requirement already satisfied: google-pasta>=0.1.6 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (0.1.8)
Requirement already satisfied: opt-einsum>=2.3.2 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (2.3.2)
Requirement already satisfied: grpcio>=1.8.6 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.26.0)
Requirement already satisfied: keras-preprocessing>=1.1.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.1.0)
Requirement already satisfied: tensorflow-estimator<2.2.0,>=2.1.0rc0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: scipy==1.2.2; python_version < "3" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.2.2)
Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: wrapt>=1.11.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.11.2)
Requirement already satisfied: backports.weakref>=1.0rc1; python_version < "3.4" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorflow->-r requirements.txt (line 1)) (1.0.post1)
Requirement already satisfied: pyyaml in /Users/survar/Library/Python/2.7/lib/python/site-packages (from keras->-r requirements.txt (line 2)) (5.3)
Requirement already satisfied: python-dateutil>=2.5.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from pandas->-r requirements.txt (line 3)) (2.8.1)
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas->-r requirements.txt (line 3)) (2013.7)
Requirement already satisfied: Click>=7.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (7.0)
Requirement already satisfied: docker-pycreds>=0.4.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (0.4.0)
Requirement already satisfied: subprocess32>=3.5.3 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (3.5.4)
Requirement already satisfied: nvidia-ml-py3>=7.352.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (7.352.0)
Requirement already satisfied: watchdog>=0.8.3 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (0.10.0)
Requirement already satisfied: gql==0.2.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (0.2.0)
Requirement already satisfied: psutil>=5.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (5.6.7)
Requirement already satisfied: requests>=2.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (2.22.0)
Requirement already satisfied: configparser>=3.8.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (4.0.2)
Requirement already satisfied: GitPython>=1.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (2.1.14)
Requirement already satisfied: sentry-sdk>=0.4.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (0.14.1)
Requirement already satisfied: shortuuid>=0.5.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from wandb->-r requirements.txt (line 6)) (0.5.0)
Requirement already satisfied: matplotlib>=2.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from scikit-image->-r requirements.txt (line 10)) (2.2.4)
Requirement already satisfied: PyWavelets>=0.4.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from scikit-image->-r requirements.txt (line 10)) (1.0.3)
Requirement already satisfied: networkx>=1.8 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from scikit-image->-r requirements.txt (line 10)) (2.2)
Requirement already satisfied: cloudpickle>=0.2.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from scikit-image->-r requirements.txt (line 10)) (1.2.2)
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from protobuf>=3.8.0->tensorflow->-r requirements.txt (line 1)) (41.0.1)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from mock>=2.0.0; python_version < "3"->tensorflow->-r requirements.txt (line 1)) (1.0.2)
Requirement already satisfied: futures>=2.2.0; python_version < "3.2" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from grpcio>=1.8.6->tensorflow->-r requirements.txt (line 1)) (3.3.0)
Requirement already satisfied: werkzeug>=0.11.15 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (0.16.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (1.11.0)
Requirement already satisfied: markdown>=2.6.8 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (3.1.1)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (0.4.1)
Requirement already satisfied: pyobjc-framework-Cocoa>=4.2.2; sys_platform == "darwin" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from watchdog>=0.8.3->wandb->-r requirements.txt (line 6)) (5.3)
Requirement already satisfied: pathtools>=0.1.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from watchdog>=0.8.3->wandb->-r requirements.txt (line 6)) (0.1.2)
Requirement already satisfied: pyobjc-framework-FSEvents>=4.2.2; sys_platform == "darwin" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from watchdog>=0.8.3->wandb->-r requirements.txt (line 6)) (5.3)
Requirement already satisfied: promise<3,>=2.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from gql==0.2.0->wandb->-r requirements.txt (line 6)) (2.3)
Requirement already satisfied: graphql-core<2,>=0.5.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from gql==0.2.0->wandb->-r requirements.txt (line 6)) (1.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from requests>=2.0.0->wandb->-r requirements.txt (line 6)) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from requests>=2.0.0->wandb->-r requirements.txt (line 6)) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from requests>=2.0.0->wandb->-r requirements.txt (line 6)) (1.25.8)
Requirement already satisfied: certifi>=2017.4.17 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from requests>=2.0.0->wandb->-r requirements.txt (line 6)) (2019.11.28)
Requirement already satisfied: gitdb2>=2.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from GitPython>=1.0.0->wandb->-r requirements.txt (line 6)) (2.0.6)
Requirement already satisfied: cycler>=0.10 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from matplotlib>=2.0.0->scikit-image->-r requirements.txt (line 10)) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from matplotlib>=2.0.0->scikit-image->-r requirements.txt (line 10)) (1.1.0)
Requirement already satisfied: backports.functools-lru-cache in /Users/survar/Library/Python/2.7/lib/python/site-packages (from matplotlib>=2.0.0->scikit-image->-r requirements.txt (line 10)) (1.6.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib>=2.0.0->scikit-image->-r requirements.txt (line 10)) (2.0.1)
Requirement already satisfied: decorator>=4.3.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from networkx>=1.8->scikit-image->-r requirements.txt (line 10)) (4.4.1)
Requirement already satisfied: rsa<4.1,>=3.1.4 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (4.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (3.1.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (1.3.0)
Requirement already satisfied: pyobjc-core>=5.3 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from pyobjc-framework-Cocoa>=4.2.2; sys_platform == "darwin"->watchdog>=0.8.3->wandb->-r requirements.txt (line 6)) (5.3)
Requirement already satisfied: typing>=3.6.4; python_version < "3.5" in /Users/survar/Library/Python/2.7/lib/python/site-packages (from promise<3,>=2.0->gql==0.2.0->wandb->-r requirements.txt (line 6)) (3.7.4.1)
Requirement already satisfied: smmap2>=2.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from gitdb2>=2.0.0->GitPython>=1.0.0->wandb->-r requirements.txt (line 6)) (2.0.5)
Requirement already satisfied: pyasn1>=0.1.3 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from rsa<4.1,>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in /Users/survar/Library/Python/2.7/lib/python/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow->-r requirements.txt (line 1)) (3.1.0)
$ cd videos
$ ls
autoencoder cnn emotion-classifier mlp text-classifier transfer-learning
cifar-augmentation cnn-audio intro one-shot text-gen video-predict
cifar-learn-rate cnn-text lstm-classifier seq2seq time-series
$ cd intro
$ ls
mlp.py perceptron-linear.py perceptron-normalize.py perceptron-single.py
mnist.png perceptron-logistic.py perceptron-single-fixed.py
$ wandb signup
Traceback (most recent call last):
File "/usr/local/bin/wandb", line 5, in
from wandb.cli import cli
File "/usr/local/lib/python3.7/site-packages/wandb/init.py", line 45, in
from wandb.apis import InternalApi, PublicApi, CommError
File "/usr/local/lib/python3.7/site-packages/wandb/apis/init.py", line 97, in
from .file_stream import FileStreamApi
File "/usr/local/lib/python3.7/site-packages/wandb/apis/file_stream.py", line 11, in
from wandb import util
File "/usr/local/lib/python3.7/site-packages/wandb/util.py", line 24, in
import yaml
ModuleNotFoundError: No module named 'yaml'
Check installation
To make sure your installation works go to the directory where this file is and run
python test-scikit.py
This currently fails, I figure scikit-learn
might be missing in requirements.txt? It's mentioned in the windows installation, https://github.com/lukas/ml-class/blob/31d046fa6bef40d9da2b6b95848d8351f83ee74d/README.md#libraries
On my reasonably-equipped home cpu-machine and on the (cpu) hub, the transfer-learning example causes OOM errors -- sometimes even before getting to the model.fit
call.
They're pretty scary-looking, if you're not expecting them, and depending on the exact system parameters, they can sometimes be triggered inside of the wandb.init
call, making it look like our fault.
Potential solutions:
Hi, when running keras-download.py I received the certificate error below. Did I miss a step in my install? Thanks, Eric
Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 220, in get_file
urlretrieve(origin, fpath, dl_progress)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "keras-download.py", line 4, in
model = ResNet50(weights='imagenet')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/applications/resnet50.py", line 258, in ResNet50
md5_hash='a7b3fe01876f51b976af0dea6bc144eb')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 222, in get_file
raise Exception(error_msg.format(origin, e.errno, e.reason))
Exception: URL fetch failure on https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5: None -- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
$
Running the following command causes the following error.
$ python smile.py
Using TensorFlow backend.
wandb: wandb dryrun mode. Use "wandb run <script>" to save results to wandb.
wandb: Run directory: wandb/dryrun-20171101_232123-fpcy4wnv
/home/peyman.mortazavi/.envs/class/lib/python3.4/site-packages/keras/models.py:848: UserWarning: The nb_epoch
argument in fit
has been renamed epochs
.
warnings.warn('The nb_epoch
argument in fit
'
Train on 11848 samples, validate on 1317 samples
Epoch 1/3
2017-11-01 23:21:30.392279: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-01 23:21:30.392322: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-01 23:21:30.392334: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-11-01 23:21:30.392342: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-11-01 23:21:30.392350: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
11848/11848 [==============================] - 31s - loss: 0.5208 - acc: 0.7261 - val_loss: 0.4176 - val_acc: 0.7715
Epoch 2/3
11848/11848 [==============================] - 28s - loss: 0.3844 - acc: 0.8390 - val_loss: 0.3714 - val_acc: 0.8679
Epoch 3/3
11848/11848 [==============================] - 28s - loss: 0.3511 - acc: 0.8688 - val_loss: 0.3096 - val_acc: 0.8884
Exception ignored in: <bound method Session.del of <tensorflow.python.client.session.Session object at 0x7fcfb5b92eb8>>
Traceback (most recent call last):
File "/home/peyman.mortazavi/.envs/class/lib/python3.4/site-packages/tensorflow/python/client/session.py", line 701, in del
TypeError: 'NoneType' object is not callable
I am running on Mac and following README file, python keras-download.py fails due to file missing
When the default encoder is not set to utf8, the data-prep.py code errors out. Might help for future classes to have the option specified.
with open("train.csv", "w") as f:
change to:
with open("train.csv", "w",encoding="utf8") as f:
note that there are 6 instances of open where adding the encoding statement should help!
Lines with issue:
Just starting on python and ML. I am working through the first example. I have 64bit anaconda python 3.7, I had to create a 3.6 conda environment to get keras etc to install. Then executing ex 1, I got the following (Is this just a 64bit python problem? and I need 32bit python?):
Traceback (most recent call last):
File "perceptron-single.py", line 10, in
run = wandb.init()
File "C:\Anaconda3\envs\ml-class\lib\site-packages\wandb_init_.py", line 1051, in init
init_headless(run)
File "C:\Anaconda3\envs\ml-class\lib\site-packages\wandb_init.py", line 223, in _init_headless
import win32api
ModuleNotFoundError: No module named 'win32api'
Thanks,
Neil
wandb is installed, but when I type in "wandb login" from command prompt, it returns "-bash: wandb: command not found"
In the RNN prediction video, a shape error is generated when the RNN outputs a 5-element hidden state when it should be outputting a 1-element hidden state.
Weirdly enough, in a more recent version of Keras, this error no longer occurs.
I suspect some weirdness is happening inside the loss function calculation.
Interestingly, the predictions on the validation data no longer line up, as can be seen in this project.
I was in the 05/09/2018 class before TrainAI conference, and one peer student reported better accuracy when replacing categorical_crossentropy
with binary_crossentropy
, and I experienced that improvement too on 2 architectures (perceptron, mlp) and possibly more.
I'd like to ask/discuss here, what the mathematics look like when apply binary cross entropy loss function to multiple-label classification? I'm speculating that the way it's enforced (although binary is supposed to work with 2 labels) happen to benefit accuracy in this problem.
Toy example and my guess:
label = [0, 0, 1, 0, 0], predict = [0.1, 0.1, 0.6, 0.1, 0.1]
categorical_crossentropy(label, predict) = -log(0.6)
binary_crossentropy(label, predict) = -log(0.6)-4*log(0.9)
I can't find where to put my own image in in this video predictor script below:
https://github.com/lukas/ml-class/blob/master/videos/video-predict/video.ipynb
Can you help me? Also I'm wondering if the cell to do it in is down below farther or above the 5 images, not sure...Also does it haveee to be ran in weights and biases? It seems to remember the folder even if I rename/move the catz folder.
instead of
Keras expects a three dimensional image
to write
Keras expects in each instance a three dimensional image
in
https://www.wandb.com/tutorial/convolutional-neural-networks
search for string
"Keras expects a three dimensional image"
Getting an error when trying to compile deep dream. Maybe an issue with py 2.7?
Gibson:ml-class usbots$ python keras-deep-dream.py
Using TensorFlow backend.
Traceback (most recent call last):
File "keras-deep-dream.py", line 54, in
model = inception_v3.InceptionV3(weights='imagenet', include_top=False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/applications/inception_v3.py", line 386, in InceptionV3
model.load_weights(weights_path)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/engine/topology.py", line 2531, in load_weights
raise ImportError('load_weights
requires h5py.')
ImportError: load_weights
requires h5py.
Gibson:ml-class usbots$ python keras-deep-dream.py
Using TensorFlow backend.
Traceback (most recent call last):
File "keras-deep-dream.py", line 55, in
include_top=False)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/applications/inception_v3.py", line 386, in InceptionV3
model.load_weights(weights_path)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/engine/topology.py", line 2531, in load_weights
raise ImportError('load_weights
requires h5py.')
ImportError: load_weights
requires h5py.
Errored when loading in perceptron.h5 (running code as is):
File "weights.py", line 49, in
weight0, bias0 = load_weights_from_keras_perceptron('perceptron.h5')
File "weights.py", line 33, in load_weights_from_keras_perceptron
bias = f['model_weights']['dense_1']['dense_1']['bias:0'][()]
KeyError: "Unable to open object (object 'model_weights' doesn't exist)"
Hi, when I run train.py
, I get the following error:
Traceback (most recent call last): File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 131, in <module> guess = ctable.decode(preds[0], calc_argmax=False) File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 41, in decode return ''.join(self.indices_char[x] for x in x) File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 41, in <genexpr> return ''.join(self.indices_char[x] for x in x) TypeError: unhashable type: 'numpy.ndarray'
Any ideas how to fix this?
ValueError: Input 0 is incompatible with layer flatten_3: expected min_ndim=3, found ndim=2
Hi! Thanks for offering the NYC Training! Running some of the scripts to make sure everything works and got some errors in feature-extraction-1.py because it didn't include the lines to remove nulls (and the 6th row of the sample data file has a null).
Thanks again!
target = target[pd.notnull(text)]
text = text[pd.notnull(text)]
I've tried installing the dependencies using pipenv but got some errors:
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
ERROR: ERROR: Could not find a version that matches keras-applications==1.0.2,>=1.0.6
After digging it seems like tensorflow requires keras-applications>=1.0.6
while forcing Keras==2.2.0
requires keras-applications>=1.0.2
tensorflow==1.13.1
- absl-py [required: >=0.1.6, installed: 0.7.1]
- six [required: Any, installed: 1.12.0]
- astor [required: >=0.6.0, installed: 0.8.0]
- gast [required: >=0.2.0, installed: 0.2.2]
- grpcio [required: >=1.8.6, installed: 1.21.1]
- six [required: >=1.5.2, installed: 1.12.0]
- keras-applications [required: >=1.0.6, installed: 1.0.7]
Keras==2.2.0
- h5py [required: Any, installed: 2.9.0]
- numpy [required: >=1.7, installed: 1.16.3]
- six [required: Any, installed: 1.12.0]
- keras-applications [required: ==1.0.2, installed: 1.0.7]
Maybe you could slightly change the requirements?
Thanks
On macOS El Capitain and later, you might run into permissions issues and the easiest way to fix this is to use the --user option so that the pip module is installed for the current user.
E.g.,:
pip install --user keras
I was having issues until I did the above.
Hi! I cloned the Github repository:
git clone https://github.com/lukas/ml-class.git
and then went on to the next step:
#### Install necessary pip libraries
Unfortunately, pip wasn't installed for some reason.
I resolved this via this Stack Overflow article: https://stackoverflow.com/questions/9780717/bash-pip-command-not-found
Why not just do sudo easy_install pip or if this is for python 2.6 sudo easy_install-2.6 pip?
This installs pip using the default python package installer system and saves you the hassle of manual set-up all at the same time.
This will allow you to then run the pip command for python package installation as it will be installed with the system python. I also recommend once you have pip using the virtualenv package and pattern. :)
UserWarning: Do not pass an input_shape
/input_dim
argument to a layer. When using Sequential models, prefer using an Input(shape)
object as the first layer in the model instead.
super().init(**kwargs)
2024-04-21 14:05:53.118504: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-04-21 14:05:53.170341: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
wandb: WARNING The save_model argument by default saves the model in the HDF5 format that cannot save custom objects like subclassed models and custom layers. This behavior will be deprecated in a future release in favor of the SavedModel format. Meanwhile, the HDF5 model is saved as W&B files and the SavedModel as W&B Artifacts.
wandb: WARNING The data_type argument of wandb.keras.WandbCallback is deprecated and will be removed in a future release. Please use input_type instead.
wandb: WARNING Setting input_type = data_type.
Traceback (most recent call last):
File "ml-class/videos/intro/perceptron-single.py", line 33, in
model.fit(X_train, is_five_train, epochs=config.epochs, validation_data=(X_test, is_five_test),
File "/home/nox/.local/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py", line 122, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/nox/.local/lib/python3.10/site-packages/wandb/integration/keras/keras.py", line 555, in set_model
self.model = model
AttributeError: can't set attribute 'model'
Traceback (most recent call last):
File "ml-class/videos/intro/perceptron-single.py", line 33, in
model.fit(X_train, is_five_train, epochs=config.epochs, validation_data=(X_test, is_five_test),
File "/home/nox/.local/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py", line 122, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/nox/.local/lib/python3.10/site-packages/wandb/integration/keras/keras.py", line 555, in set_model
self.model = model
AttributeError: can't set attribute 'model'
wandb: ๐ View run dark-spaceship-22 at: https://wandb.ai/dailynet/ml-class-videos_intro/runs/yrv31kua
wandb: โญ๏ธ View project at: https://wandb.ai/dailynet/ml-class-videos_intro
wandb: Synced 5 W&B file(s), 0 media file(s), 2 artifact file(s) and 0 other file(s)
wandb: Find logs at: ./wandb/run-20240421_140549-yrv31kua/logs
I suppose some things must have changed since the course was released.
(venv) nelsnelson@neptuno:~/Documents/code/ml-class/videos/intro[master]$ python perceptron-single.py
Traceback (most recent call last):
File "/Users/nelsnelson/Documents/code/ml-class/videos/intro/perceptron-single.py", line 4, in <module>
from keras.utils import np_utils
ImportError: cannot import name 'np_utils' from 'keras.utils' (/Users/nelsnelson/Documents/code/ml-class/venv/lib/python3.9/site-packages/keras/utils/__init__.py)
I've run the training with your code on the mnist dataset and am trying to figure out how to check / predict a value from an image of a number six I created. I'm sure there's a whole lot wrong with this code. Could you help me understand this a bit more? I'm new to ML.
I had saved the h5 file using model.save at the end of training. but seems I have to load it using load_weights
and not just load
. I'd like to load everything including the ??model state??
please advise.
import random
import numpy as np
import keras
import sys
# import wandb
# from wandb.keras import WandbCallback
from keras.models import Sequential, Model
from keras.layers import Flatten, Dense, Concatenate, Dot, Lambda, Input
from keras.datasets import mnist
from keras.optimizers import Adam
import matplotlib.pyplot as plt
from keras import backend as K
import scipy
import cv2
def debug(*args):
for arg in args:
print(arg)
sys.exit()
def euclidean_distance(vects):
x, y = vects
sum_square = K.sum(K.square(x - y), axis=1, keepdims=True)
return K.sqrt(K.maximum(sum_square, K.epsilon()))
# 3 channel images of arbitrary shape
inp = Input(shape=(3, None, None))
try:
out = Lambda(lambda image: K.resize_images(image, (28, 28), "channels_first"))(inp)
except :
# if you have older version of tensorflow
out = Lambda(lambda image: K.resize_images(image, 28, 28, "channels_first"))(inp)
model = Model(input=inp, output=out)
input = Input((28,28))
x = Flatten()(input)
x = Dense(128, activation='relu')(x)
dense = Model(input, x)
input1 = Input((28,28))
input2 = Input((28,28))
dense1 = dense(input1)
dense2 = dense(input2)
merge_layer = Lambda(euclidean_distance)([dense1,dense2])
dense_layer = Dense(1, activation="sigmoid")(merge_layer)
model = Model(inputs=[input1, input2], outputs=dense_layer)
model.load_weights("mnist.h5")
model.summary()
X = cv2.imread('six.png')
X = cv2.resize(X, (28, 28))
X.shape = (3, 28, 28)
out = model.predict(X[np.newaxis, ...])
fig, Axes = plt.subplots(nrows=1, ncols=2)
Axes[0].imshow(X)
Axes[1].imshow(np.int8(out[0,...]))
plt.show()
Hi @lukas. With this issue, I don't anyway want to demean anything. I understand that things can go wrong sometimes behind our eyes. Firstly, thank you very much to you and your team for developing Weights and Biases. I am really becoming an active user of the library.
This issue struck my mind when I was going through your awesome of tutorials on a bunch of cool topics in deep learning. When going through the tutorial on Time-series and Character Generation, I found out that the datasets were not there where they should be. Moreover, the .txt
files required for the Character generation tutorial was not present at all. Would be great if you could put together those files sometime.
https://github.com/lukas/ml-class/blob/master/videos/cnn-audio/audio.ipynb
run with
model = Sequential()
model.add(LSTM(16, input_shape=(config.buckets, config.max_len, channels), activation="sigmoid"))
model.add(Dense(1, activation='sigmoid'))
model.add(Dense(num_classes, activation='softmax'))
model.compile(loss="categorical_crossentropy",
optimizer="adam",
metrics=['accuracy'])
wandb.init()
model.fit(X_train, y_train_hot, epochs=config.epochs, validation_data=(X_test, y_test_hot), callbacks=[WandbCallback(data_type="image", labels=labels)])
Got
WARNING:tensorflow:From /home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
WARNING:tensorflow:From /home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
Traceback (most recent call last):
File "audio.py", line 56, in
model.add(LSTM(16, input_shape=(config.buckets, config.max_len, channels), activation="sigmoid"))
File "/home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/engine/sequential.py", line 165, in add
layer(x)
File "/home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/layers/recurrent.py", line 532, in call
return super(RNN, self).call(inputs, **kwargs)
File "/home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/engine/base_layer.py", line 414, in call
self.assert_input_compatibility(inputs)
File "/home/jing/anaconda3/envs/venv_ai/lib/python3.7/site-packages/keras/engine/base_layer.py", line 311, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=4
wandb: Waiting for W&B process to finish, PID 11125
wandb: Program failed with code 1. Press ctrl-c to abort syncing.
wandb: Syncing 6 W&B file(s) and 0 media file(s)
wandb:
wandb: Synced wandering-salad-3: https://app.wandb.ai/jing/ml-class-videos_cnn-audio/runs/y7wdkao7
perceptron-linear.py
is not interacting correctly with tensorflow, even though tests from tensorFlow verify that it is correctly installed. Other issues include a missing keras-datasets
folder.
this confused me for a while, re: my question about whether when we do cross-validation do we start with a new model each iteration or do we improve an existing model.
https://github.com/lukas/ml-class/blob/master/videos/cnn-text/download-imdb.py
https://github.com/lukas/ml-class/blob/master/videos/cnn-text/imdb.py
I think the intended contents of download-imdb.py may have been replaced with the (correct) contents of imdb.py.
Thanks for the videos ... no idea why you are not getting more views, likes and & subscribes. Maybe try to do some ASMR or unboxing ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.