andreasveit / triplet-network-pytorch

370 stars 95 forks source link

TypeError: a bytes-like object is required, not 'str' #4

Closed kissste closed 6 years ago

kissste commented 6 years ago

Processing Triplet Generation ... Traceback (most recent call last): File "train.py", line 257, in main()
File "train.py", line 61, in main transforms.Normalize((0.1307,), (0.3081,)) File "/home/qwe/triplet-network-pytorch/triplet_mnist_loader.py", line 44, in init self.make_triplet_list(n_train_triplets) File "/home/qwe/triplet-network-pytorch/triplet_mnist_loader.py", line 164, in make_triplet_list writer.writerows(triplets) TypeError: a bytes-like object is required, not 'str'

cdluminate commented 6 years ago

Same error here. The code needs to be ported to python3.

Paul0M commented 6 years ago

change 'wb' to 'w' in line 162 in triplet_mnist_loader.py

andreasveit commented 6 years ago

Thanks for the comment. The code is updated.