davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.84k stars 4.81k forks source link

Calculate attribute vectors: TypeError: object of type 'map' has no len() #393

Open bousejin opened 7 years ago

bousejin commented 7 years ago

Hi. Thanks for this great project. I am using floydhub to replicate results of this project. In step 2 of training variational autoencoder to calculate vectors in latent variable space after running the provided command I'v got the following error:

Traceback (most recent call last): 2017-07-29 07:26:59,506 INFO - File "src/generative/calculate_attribute_vectors.py", line 199, in 2017-07-29 07:26:59,507 INFO - main(parse_arguments(sys.argv[1:])) 2017-07-29 07:26:59,507 INFO - File "src/generative/calculate_attribute_vectors.py", line 65, in main 2017-07-29 07:26:59,507 INFO - assert len(attr)==nrof_attributes 2017-07-29 07:26:59,508 INFO - TypeError: object of type 'map' has no len()

How could you run this script with no error?

pixieDoug commented 6 years ago

I too am receiving the same error. Has anyone had an opportunity to investigate?

Thanks!

pixieDoug commented 6 years ago

I believe the fix is with python 3.3+: In line 168, change to: img_attribs = list(map(int, line[1:]))