8. Pre-Trained Networks
Activity 8.01: Fruit Classification with Fine-Tuning
Solution:
- Open a new Jupyter notebook.
- Import the TensorFlow library as
tf
:import tensorflow as tf
- Create a variable called
file_url
containing a link to the dataset:file_url = 'https://github.com/PacktWorkshops/'\ Â Â Â Â Â Â Â Â Â Â 'The-TensorFlow-Workshop/blob/master'\ Â Â Â Â Â Â Â Â Â Â '/Chapter08/dataset/fruits360.zip'
- Download the dataset using
tf.keras.get_file
with'fruits360.zip'
,origin=file_url
, andextract=True
as parameters, and save the result to a variable calledzip_dir
:zip_dir = tf.keras.utils.get_file('fruits360.zip', \ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â origin=file_url...