XLnet-gen icon indicating copy to clipboard operation
XLnet-gen copied to clipboard

Nothing happens when generating with the ---PROMPT---

Open timpal0l opened this issue 5 years ago • 3 comments

----PROMPT----
Hello world, this is some sample text that you can use!!   
WARNING:tensorflow:From /home/timisb/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py:494: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
    options available in V2.
    - tf.py_function takes a python function which manipulates tf eager
    tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
    an ndarray (just call tensor.numpy()) but having access to eager tensors
    means `tf.py_function`s can use accelerators such as GPUs as well as
    being differentiable using a gradient tape.
    - tf.numpy_function maintains the semantics of the deprecated tf.py_func
    (it is not differentiable, and manipulates numpy arrays). It drops the
    stateful argument making all functions stateful.
    
WARNING:tensorflow:From language_generation.py:603: DatasetV1.make_one_shot_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `for ... in dataset:` to iterate over a dataset. If using `tf.estimator`, return the `Dataset` object directly from your input function. As a last resort, you can use `tf.compat.v1.data.make_one_shot_iterator(dataset)`.
  0%|                                                                                                                                               | 0/1 [00:00<?, ?it/s]

Been stuck like this for 1 hour.

timpal0l avatar Aug 29 '19 14:08 timpal0l

Maybe it is too slow on your system? What are your hardware specs?

On Thu, Aug 29, 2019 at 7:53 PM timpal0l [email protected] wrote:

----PROMPT---- Hello world, this is some sample text that you can use!! WARNING:tensorflow:From /home/timisb/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py:494: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version. Instructions for updating: tf.py_func is deprecated in TF V2. Instead, there are two options available in V2. - tf.py_function takes a python function which manipulates tf eager tensors instead of numpy arrays. It's easy to convert a tf eager tensor to an ndarray (just call tensor.numpy()) but having access to eager tensors means tf.py_functions can use accelerators such as GPUs as well as being differentiable using a gradient tape. - tf.numpy_function maintains the semantics of the deprecated tf.py_func (it is not differentiable, and manipulates numpy arrays). It drops the stateful argument making all functions stateful.

WARNING:tensorflow:From language_generation.py:603: DatasetV1.make_one_shot_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version. Instructions for updating: Use for ... in dataset: to iterate over a dataset. If using tf.estimator, return the Dataset object directly from your input function. As a last resort, you can use tf.compat.v1.data.make_one_shot_iterator(dataset). 0%| | 0/1 [00:00<?, ?it/s]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rusiaaman/XLnet-gen/issues/8?email_source=notifications&email_token=AIKQ2WBZ7K4G2G3GWYRN273QG7LVNA5CNFSM4ISC5QFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIG4G3Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AIKQ2WAKF3EPDMBWICG7OY3QG7LVNANCNFSM4ISC5QFA .

rusiaaman avatar Aug 29 '19 15:08 rusiaaman

I'm seeing the same thing:

  • 2017 MacBook Pro
  • MacOS v10.14.6
  • 2.9 GHz Intel Core i7
  • 16GB RAM
  • Python 3.7
  • Conda Env

The Python process appears to be using multiple cores and about 5-7 GB of memory.

jeremyfromearth avatar Sep 05 '19 16:09 jeremyfromearth

I modified the arguments a bit and was able to get some decent results:

Tonight the world's first ever launch of the Thundertron is taking place, bringing together the world, cities, countries, large and small, some from across the globe with the new, open and spectacular City of the Thunder.

python language_generation.py
--model_config_path=xlnet_cased_L-24_H-1024_A-16/xlnet_config.json
--init_checkpoint=xlnet_cased_L-24_H-1024_A-16/xlnet_model.ckpt
--spiece_model_file=xlnet_cased_L-24_H-1024_A-16/spiece.model
--interactive
--max_mem_length=64
--num_toks_pred=64
--num_samples=1
--top_p=0.9
--bidirectional_eachstep

jeremyfromearth avatar Sep 05 '19 17:09 jeremyfromearth