Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coding issue #4

Open
ronimittal opened this issue Jul 3, 2019 · 1 comment
Open

coding issue #4

ronimittal opened this issue Jul 3, 2019 · 1 comment

Comments

@ronimittal
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants