Facing an error on getting features of random image

When i am trying to get the encoded features of a random image , as done in video at 7:46 , i am getting the following error, please if you can check for the error?