PracticalDL / Practical-Deep-Learning-Book

Official code repo for the O'Reilly Book - Practical Deep Learning for Cloud, Mobile & Edge
http://practicaldeeplearning.ai
MIT License
751 stars 314 forks source link

chapter-4/1_feature_extraction.ipynb assumed running on colab #163

Open gitgithan opened 1 year ago

gitgithan commented 1 year ago

features = extract_features('cat.jpg', model) is assuming it is run in colab. I suggest features = extract_features(IMG_PATH, model) so it also works locally off colab and uses IMG_PATH which was defined in the cell right before

IMG_PATH = '../../sample-images/cat.jpg'
if IS_COLAB_ENV:
  !curl https://raw.githubusercontent.com/PracticalDL/Practical-Deep-Learning-Book/master/sample-images/cat.jpg --output cat.jpg
  IMG_PATH = 'cat.jpg'

Same for the %timeit features = extract_features('cat.jpg', model) line, to change to %timeit features = extract_features(IMG_PATH, model)