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

unable to install tensorflow==1.4.1 for python 2.7 #4

Open
medasuryatej opened this issue Jul 20, 2018 · 6 comments
Open

unable to install tensorflow==1.4.1 for python 2.7 #4

medasuryatej opened this issue Jul 20, 2018 · 6 comments

Comments

@medasuryatej
Copy link

It is mentioned in the code that it is written in Tensorflow==1.4.1 in Python 2.7
I am unable to install Tensorflow==1.4.1 in Python 2.7 Environment. I am able to install Tensorflow only in python 3.5 and above. When I try to run main.py with I facing several Python 2.7 to 3.6 compatibility issues

Error While installing Tensorflow in Python 2.7

C:\Python27\Scripts>pip install tensorflow==1.4.0 --proxy approxy.rockwellcollins.com:9090
Collecting tensorflow==1.4.0
  Could not find a version that satisfies the requirement tensorflow==1.4.0 (from versions: )
No matching distribution found for tensorflow==1.4.0

My OS: Windows 10
Anaconda 64 bit Environment
Tensorflowversion 1.4
Python 3.6.5

Error with Python 3.6.5

(squad) D:\cs224n-Squad-Project>python D://cs224n-Squad-Project//code//main.py --experiment_name=bidaf_best --dropout=0.15 --batch_size=60 --hidden_size_encoder=150 --embedding_size=100 --do_char_embed=False --add_highway_layer=True --rnet_attention=False --bidaf_attention=True --answer_pointer_RNET=False --smart_span=True --hidden_size_modeling=150 --mode=train
This code was developed and tested on TensorFlow 1.4.1. Your TensorFlow version: 1.4.0
Loading GLoVE vectors from file: .\data\glove.6B.100d.txt
  0%|                                                                                                                          | 0/400000 [00:00<?, ?it/s]Traceback (most recent call last):
  File "D://cs224n-Squad-Project//code//main.py", line 232, in <module>
    tf.app.run()
  File "C:\anaconda3\envs\squad\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "D://cs224n-Squad-Project//code//main.py", line 150, in main
    emb_matrix, word2id, id2word = get_glove(FLAGS.glove_path, FLAGS.embedding_size)
  File "D:\cs224n-Squad-Project\code\vocab.py", line 67, in get_glove
    for line in tqdm(fh, total=vocab_size):
  File "C:\anaconda3\envs\squad\lib\site-packages\tqdm\_tqdm.py", line 930, in __iter__
    for obj in iterable:
  File "C:\anaconda3\envs\squad\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2776: character maps to <undefined>
@medasuryatej
Copy link
Author

Was able to solve it, by opening every file with encoding="utf8" in the code

@dhrths
Copy link

dhrths commented Aug 16, 2018

can you please tell me what do you mean by 'opening every file with encoding="utf8"?

@medasuryatej
Copy link
Author

the encoding of the file caused an issue UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2776: character maps to
So I had to change the file encoding to utf8 while reading/writing, and it worked

@dhrths
Copy link

dhrths commented Aug 16, 2018

The file encoding in main.py is already in utf-8 coding...where do we have to change?

@medasuryatej
Copy link
Author

medasuryatej commented Aug 16, 2018 via email

@mandarmp
Copy link

use python 3+ but convert each file using (2to3 -w filename) command.

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

3 participants