neerajgosai19 / CONVOLUTIONAL-NEURAL-NETWORK

0 stars 0 forks source link

DEEP LEARNING #3

Open neerajgosai19 opened 4 years ago

neerajgosai19 commented 4 years ago

Reads the data and separates it into training data, validation data and testing data

raw_data = reader.ptb_raw_data(data_dir) train_data, valid_data, test_data, vocab, word_to_id = raw_data


AttributeError Traceback (most recent call last)

in 1 # Reads the data and separates it into training data, validation data and testing data ----> 2 raw_data = reader.ptb_raw_data(data_dir) 3 train_data, valid_data, test_data, vocab, word_to_id = raw_data /resources/labs/ML0120EN/reader.py in ptb_raw_data(data_path) 72 test_path = os.path.join(data_path, "ptb.test.txt") 73 ---> 74 word_to_id = _build_vocab(train_path) 75 train_data = _file_to_word_ids(train_path, word_to_id) 76 valid_data = _file_to_word_ids(valid_path, word_to_id) /resources/labs/ML0120EN/reader.py in _build_vocab(filename) 33 34 def _build_vocab(filename): ---> 35 data = _read_words(filename) 36 37 counter = collections.Counter(data) /resources/labs/ML0120EN/reader.py in _read_words(filename) 28 29 def _read_words(filename): ---> 30 with tf.gfile.GFile(filename, "r") as f: 31 return f.read().replace("\n", "").split() 32 AttributeError: module 'tensorflow' has no attribute 'gfile'
iamAbhishekkumar commented 4 years ago

Read the last line of error...it's an attribute error... I think it should be ... tf.io.gfile.G...