Practical-Deep-Learning-Book icon indicating copy to clipboard operation
Practical-Deep-Learning-Book copied to clipboard

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

Open gitgithan opened this issue 2 years ago • 0 comments

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)

gitgithan avatar Feb 10 '23 13:02 gitgithan