TensorFlow-Examples icon indicating copy to clipboard operation
TensorFlow-Examples copied to clipboard

Word2Vec

Open KylinA1 opened this issue 6 years ago • 3 comments

It seems this code is written in python2. It may come across several problems.

  1. for reading data part. using text_words = (f.read(f.namelist()[0]).lower().decode('utf-8')).split() or text_words =tf.compat.as_str(f.read(f.namelist()[0])).split() convert b string to str
  2. xrange to range

KylinA1 avatar Aug 08 '18 15:08 KylinA1

thank you!

cdlwhm1217096231 avatar Dec 13 '18 06:12 cdlwhm1217096231

Very thanks!

Jerryten avatar Feb 26 '19 08:02 Jerryten

in python3,

  1. I change xrange to range
  2. run, and occur the error, AttributeError: module 'urllib' has no attribute 'urlretrieve' Fixed by follow:
filename, _ = urllib.urlretrieve(url, data_path)

need to change

filename, _ = urllib.request.urlretrieve(url, data_path)

Valuebai avatar Sep 18 '19 10:09 Valuebai