sujitpal / holiday-similarity

Finding similar images in the Holidays dataset
Apache License 2.0
103 stars 48 forks source link

coding issue #4

Open ronimittal opened 5 years ago

ronimittal commented 5 years ago
in ** > _vectorize_images(image_dir, image_size, preprocessor, model, vector_file, batch_size) > 24 print("{:d} vectors generated".format(num_vecs)) > 25 image_vector = ",".join(["{:.5e}".format(v) for v in vectors[i].tolist()]) > ---> 26 fvec.write("{:s}\t{:s}\n".format(image_batch[i], image_vector)) > 27 num_vecs += 1 > 28 print("{:d} vectors generated".format(num_vecs)) > > TypeError: a bytes-like object is required, not 'str'_** I am trying to fit your code in a classification problem using transfer learning but getting this error. Could you please tell why is that and how to rectify it?
prajotsl123 commented 4 years ago

replace "fvec = open(vector_file, "wb")" with "fvec = open(vector_file, "w")"