Tensorflow implementation of Character-Aware Neural Language Models.

Overview

Character-Aware Neural Language Models

Tensorflow implementation of Character-Aware Neural Language Models. The original code of author can be found here.

model.png

This implementation contains:

  1. Word-level and Character-level Convolutional Neural Network
  2. Highway Network
  3. Recurrent Neural Network Language Model

The current implementation has a performance issue. See #3.

Prerequisites

Usage

To train a model with ptb dataset:

$ python main.py --dataset ptb

To test an existing model:

$ python main.py --dataset ptb --forward_only True

To see all training options, run:

$ python main.py --help

which will print

usage: main.py [-h] [--epoch EPOCH] [--word_embed_dim WORD_EMBED_DIM]
              [--char_embed_dim CHAR_EMBED_DIM]
              [--max_word_length MAX_WORD_LENGTH] [--batch_size BATCH_SIZE]
              [--seq_length SEQ_LENGTH] [--learning_rate LEARNING_RATE]
              [--decay DECAY] [--dropout_prob DROPOUT_PROB]
              [--feature_maps FEATURE_MAPS] [--kernels KERNELS]
              [--model MODEL] [--data_dir DATA_DIR] [--dataset DATASET]
              [--checkpoint_dir CHECKPOINT_DIR]
              [--forward_only [FORWARD_ONLY]] [--noforward_only]
              [--use_char [USE_CHAR]] [--nouse_char] [--use_word [USE_WORD]]
              [--nouse_word]

optional arguments:
  -h, --help            show this help message and exit
  --epoch EPOCH         Epoch to train [25]
  --word_embed_dim WORD_EMBED_DIM
                        The dimension of word embedding matrix [650]
  --char_embed_dim CHAR_EMBED_DIM
                        The dimension of char embedding matrix [15]
  --max_word_length MAX_WORD_LENGTH
                        The maximum length of word [65]
  --batch_size BATCH_SIZE
                        The size of batch images [100]
  --seq_length SEQ_LENGTH
                        The # of timesteps to unroll for [35]
  --learning_rate LEARNING_RATE
                        Learning rate [1.0]
  --decay DECAY         Decay of SGD [0.5]
  --dropout_prob DROPOUT_PROB
                        Probability of dropout layer [0.5]
  --feature_maps FEATURE_MAPS
                        The # of feature maps in CNN
                        [50,100,150,200,200,200,200]
  --kernels KERNELS     The width of CNN kernels [1,2,3,4,5,6,7]
  --model MODEL         The type of model to train and test [LSTM, LSTMTDNN]
  --data_dir DATA_DIR   The name of data directory [data]
  --dataset DATASET     The name of dataset [ptb]
  --checkpoint_dir CHECKPOINT_DIR
                        Directory name to save the checkpoints [checkpoint]
  --forward_only [FORWARD_ONLY]
                        True for forward only, False for training [False]
  --noforward_only
  --use_char [USE_CHAR]
                        Use character-level language model [True]
  --nouse_char
  --use_word [USE_WORD]
                        Use word-level language [False]
  --nouse_word

but more options can be found in models/LSTMTDNN and models/TDNN.

Performance

Failed to reproduce the results of paper (2016.02.12). If you are looking for a code that reproduced the paper's result, see https://github.com/mkroutikov/tf-lstm-char-cnn.

loss

The perplexity on the test sets of Penn Treebank (PTB) corpora.

Name Character embed LSTM hidden units Paper (Y Kim 2016) This repo.
LSTM-Char-Small 15 100 92.3 in progress
LSTM-Char-Large 15 150 78.9 in progress

Author

Taehoon Kim / @carpedm20

Comments
  • Program break due to tensorflow version

    Program break due to tensorflow version

    Hi, I'm using Python2.7 and tensorflow1.0.0 to run this project. The project first got "TypeError: slice indices must be integers or None" in: "batch_loader.py", line 49, in init data = data[: batch_size * seq_length * math.floor(length / (batch_size * seq_length))] I fixed this by change it to: data = data[: int(batch_size * seq_length * math.floor(length / (batch_size * seq_length)))] Then the project got ValueError in "LSTMTDNN.py", line 126, in prepare_model char_index = tf.reshape(char_indices[idx], [-1, self.max_word_length]) ValueError: Dimension size must be evenly divisible by 21 but is 1 for 'LSTMTDNN/CNN/Reshape' (op: 'Reshape') with input shapes: [], [2].

    The number 21 for ptb dataset and 65 for nsmc dataset.

    What should I do? Thanks!

    opened by sushanwang 2
  • crushed when use both char and word

    crushed when use both char and word

    hi carpedm20, When I set both "use_char" and "use_word" to True, program cannot run correctly: flags.DEFINE_boolean("use_char", True, "Use character-level language model [True]") flags.DEFINE_boolean("use_word", True, "Use word-level language [False]")

    models/LSTMTDNN.py line 102: if self.use_char: char_W = tf.get_variable("char_embed", [self.char_vocab_size, self.char_embed_dim]) else: word_W = tf.get_variable("word_embed", [self.word_vocab_size, self.word_embed_dim])

    should modified to: if self.use_char: char_W = tf.get_variable("char_embed", [self.char_vocab_size, self.char_embed_dim]) if self.use_word: word_W = tf.get_variable("word_embed", [self.word_vocab_size, self.word_embed_dim])

    In addition, line 132(models/LSTMTDNN.py), is it a syntax error when using tf.concat: cnn_output = tf.concat(1, char_cnn.output, word_embed)

    shoud it be modified to: cnn_output = tf.concat(1, [char_cnn.output, tf.squeeze(word_embed, [1])]) ?

    opened by stevesyang 1
  • `tf.Tensor`  as Python boolean error

    `tf.Tensor` as Python boolean error

    Hi, While running python main.py --dataset ptb, I got an error :

    data = data[: batch_size * seq_length * math.floor(length / (batch_size * seq_length))]
    data load done. Number of batches in train: 265, val: 21, test: 23
    Word vocab size: 10001, Char vocab size: 51, Max word length (incl. padding): 21
    Traceback (most recent call last):
    File "main.py", line 66, in <module> tf.app.run()
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run sys.exit(main(sys.argv))
    File "main.py", line 60, in main model.run(FLAGS.epoch, FLAGS.learning_rate, FLAGS.decay)
    File "/Users/artur-imac/nn-models/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 269, in run
        if grad:
    File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 475, in __nonzero__
        raise TypeError("Using a `tf.Tensor` as a Python `bool` is not allowed. "
    TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use the logical TensorFlow ops to test the value of a tensor.
    

    I am using TensorFlow 0.8 with Python2.

    opened by aigujin 1
  • did anybody successfully train?

    did anybody successfully train?

    with GPU I just reduced a lot of options such as batch size, feature_maps etc.

    Always OOM occured!!

    Resource exhausted: OOM when allocating tensor with shape[50,450537] W tensorflow/core/common_runtime/executor.cc:1102] 0x8bcfce0 Compute status: Resource exhausted: OOM when allocating tensor with shape[50,450537] [[Node: LSTMTDNN/LSTM/Linear_34/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](LSTMTDNN/LSTM/dropout_34/mul_1, LSTMTDNN/LSTM/Linear/Matrix/read)]] I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 2987 get requests, put_count=1597 evicted_count=1000 eviction_rate=0.626174 and unsatisfied allocation rate=0.833612

    opened by badend 1
  • Failed to train on the ptb dataset

    Failed to train on the ptb dataset

    Python 2.7.6 on Ubuntu 14.04.3

    $ python main.py --dataset ptb

    Reshaping tensors... data load done. Number of batches in train: 265, val: 21, test: 23 Word vocab size: 10001, Char vocab size: 51, Max word length (incl. padding): 21 Traceback (most recent call last): File "main.py", line 66, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/app.py", line 11, in run sys.exit(main(sys.argv)) File "main.py", line 57, in main data_dir=FLAGS.data_dir) File "/mnt/win/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 86, in init self.prepare_model() File "/mnt/win/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 144, in prepare_model cnn_output = highway(cnn_output, cnn_output.get_shape()[1], self.highway_layers, 0) File "/mnt/win/lstm-char-cnn-tensorflow/models/ops.py", line 28, in highway output = f(rnn_cell.linear(output, size, 0, scope='output_lin%d' % idx)) TypeError: 'module' object is not callable

    opened by ygoncharov 1
  • TypeError: 'module' object is not callable

    TypeError: 'module' object is not callable

    I tried to run the code (python main.py --dataset ptb), and it failed with this exception:

    ...
    Creating vocab...
    After first pass of data, max word length is: 21
    Token count: train 929589, val 73760, test 82430
    Loading vocab...
    Word vocab size: 10001, Char vocab size: 51
    Reshaping tensors...
    data load done. Number of batches in train: 265, val: 21, test: 23
    Word vocab size: 10001, Char vocab size: 51, Max word length (incl. padding): 21
    Traceback (most recent call last):
      File "main.py", line 66, in <module>
        tf.app.run()
      File "/home/ndavid/venvs/embedding/local/lib/python2.7/site-packages/tensorflow/python/platform/default/_app.py", line 11, in run
        sys.exit(main(sys.argv))
      File "main.py", line 57, in main
        data_dir=FLAGS.data_dir)
      File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 86, in __init__
        self.prepare_model()
      File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 144, in prepare_model
        cnn_output = highway(cnn_output, cnn_output.get_shape()[1], self.highway_layers, 0)
      File "/mnt/store/ndavid/LM/Others/lstm-char-cnn-tensorflow/models/ops.py", line 28, in highway
        output = f(rnn_cell.linear(output, size, 0, scope='output_lin_%d' % idx))
    TypeError: 'module' object is not callable
    

    I am using tensorflow version 0.5 (I think that's the latest one, but I am not sure).

    opened by DavidNemeskey 1
  • can you provide a ptb or link?

    can you provide a ptb or link?

    hello, I am a fresh hand for text. I do not know how to make a ptb file for the command python main.py --dataset ptb. Can you provide a ptb file or link?

    thank you very much!

    opened by PapaMadeleine2022 0
  • did anybody successfully train?

    did anybody successfully train?

    with GPU I just reduced a lot of options such as batch size, feature_maps etc.

    Always OOM occured!!

    Resource exhausted: OOM when allocating tensor with shape[50,450537] W tensorflow/core/common_runtime/executor.cc:1102] 0x8bcfce0 Compute status: Resource exhausted: OOM when allocating tensor with shape[50,450537] [[Node: LSTMTDNN/LSTM/Linear_34/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](LSTMTDNN/LSTM/dropout_34/mul_1, LSTMTDNN/LSTM/Linear/Matrix/read)]] I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 2987 get requests, put_count=1597 evicted_count=1000 eviction_rate=0.626174 and unsatisfied allocation rate=0.833612

    opened by badend 0
  • Py3 tf 1.8

    Py3 tf 1.8

    version log:

    1. supported python3.x
    2. modify some codes to support tensorflow 1.8.0
    

    test info:

    test machine platform: Ubuntu 16.04.5 x86_64 GPU
    test python version: 3.5.2
    test tensorflow version: 1.8.0
    

    Also fix #26 and #20

    opened by kaierlong 0
  • ModuleNotFoundError: No module named '__main__.models'; '__main__' is not a package

    ModuleNotFoundError: No module named '__main__.models'; '__main__' is not a package

    When I run the code I meet following message,who can help?thanks

    Traceback (most recent call last): File "/home/hx/Downloads/lstm-char-cnn-tensorflow-master/main.py", line 5, in from .models import LSTMTDNN ModuleNotFoundError: No module named 'main.models'; 'main' is not a package

    opened by hxpotato 0
  • ValueError: Dimensions must be equal, but are 1300 and 1750 for 'LSTMTDNN/LSTM/rnn/rnn/multi_rnn_cell/cell_0/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [100,1300], [1750,2600].

    ValueError: Dimensions must be equal, but are 1300 and 1750 for 'LSTMTDNN/LSTM/rnn/rnn/multi_rnn_cell/cell_0/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [100,1300], [1750,2600].

    After I did some modification following the guides given by https://github.com/carpedm20/lstm-char-cnn-tensorflow/issues/23 and https://github.com/carpedm20/lstm-char-cnn-tensorflow/issues/20, there is still some errors when running the program.

    Traceback (most recent call last): File "/home/ymzhu/pycharm-2017.2.3/helpers/pydev/pydevd.py", line 1599, in globals = debugger.run(setup['file'], None, None, is_module) File "/home/ymzhu/pycharm-2017.2.3/helpers/pydev/pydevd.py", line 1026, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/ymzhu/Desktop/code/lstm-char-cnn-tensorflow/main.py", line 66, in tf.app.run() File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(sys.argv[:1] + flags_passthrough)) File "/home/ymzhu/Desktop/code/lstm-char-cnn-tensorflow/main.py", line 57, in main data_dir=FLAGS.data_dir) File "/home/ymzhu/Desktop/code/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 87, in init self.prepare_model() File "/home/ymzhu/Desktop/code/lstm-char-cnn-tensorflow/models/LSTMTDNN.py", line 155, in prepare_model dtype=tf.float32) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 1253, in static_rnn (output, state) = call_cell() File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 1240, in call_cell = lambda: cell(input, state) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in call return super(RNNCell, self).call(inputs, state) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 575, in call outputs = self.call(inputs, *args, **kwargs) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1066, in call cur_inp, new_state = cell(cur_inp, cur_state) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in call return super(RNNCell, self).call(inputs, state) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 575, in call outputs = self.call(inputs, *args, **kwargs) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 441, in call value=self._linear([inputs, h]), num_or_size_splits=4, axis=1) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1189, in call res = math_ops.matmul(array_ops.concat(args, 1), self._weights) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1891, in matmul a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 2437, in _mat_mul name=name) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op set_shapes_for_outputs(ret) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs shapes = shape_func(op) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn require_shape_fn) File "/home/ymzhu/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Dimensions must be equal, but are 1300 and 1750 for 'LSTMTDNN/LSTM/rnn/rnn/multi_rnn_cell/cell_0/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [100,1300], [1750,2600].

    Why did this happen? Could anyone help?

    opened by Yaoming95 0
  • IndexError: index 0 is out of bounds for axis 0 with size 0

    IndexError: index 0 is out of bounds for axis 0 with size 0

    Python 3.6.3, tensorflow-1.4.0 on Windows 7 Ultimate SP1 python main.py --dataset ptb self.loader = BatchLoader(self.data_dir, self.dataset_name, self.batch_size, self.seq_length, self.max_word_length) File "C:\Users\akuo\lstm-char-cnn-tensorflow\batch_loader.py", line 52, in init ydata[-1] = data[0].copy() IndexError: index 0 is out of bounds for axis 0 with size 0

    there are quite a few -1 in batch_loader.py, should I replace them all to 0 ?

    opened by rkuo2000 0
  • TypeError: slice indices must be integers or None or have an __index__ method

    TypeError: slice indices must be integers or None or have an __index__ method

    I tried to run the code line (python main.py --dataset ptb) and got the following error. I am using tensorflow 1.0.1 danish@amax:~/trycode/lstm-char-cnn-tensorflow-master$ python main.py --dataset ptb I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally {'batch_size': 100, 'char_embed_dim': 15, 'checkpoint_dir': 'checkpoint', 'data_dir': 'data', 'dataset': 'ptb', 'decay': 0.5, 'dropout_prob': 0.5, 'epoch': 25, 'feature_maps': '[50,100,150,200,200,200,200]', 'forward_only': False, 'kernels': '[1,2,3,4,5,6,7]', 'learning_rate': 1.0, 'max_word_length': 65, 'model': 'LSTMTDNN', 'seq_length': 35, 'use_char': True, 'use_word': False, 'word_embed_dim': 650} [*] Creating checkpoint directory... W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:04:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2112820 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 1 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:05:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x21161b0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 2 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:08:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2119b40 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 3 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:09:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x211d4d0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 4 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:83:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2120e60 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 5 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:84:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x21247f0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 6 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:87:00.0 Total memory: 22.40GiB Free memory: 22.29GiB W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2128430 I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 7 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate (GHz) 1.112 pciBusID 0000:88:00.0 Total memory: 22.40GiB Free memory: 22.29GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 0 and 4 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 0 and 5 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 0 and 6 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 0 and 7 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 1 and 4 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 1 and 5 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 1 and 6 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 1 and 7 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 2 and 4 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 2 and 5 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 2 and 6 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 2 and 7 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 3 and 4 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 3 and 5 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 3 and 6 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 3 and 7 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 4 and 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 4 and 1 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 4 and 2 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 4 and 3 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 5 and 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 5 and 1 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 5 and 2 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 5 and 3 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 6 and 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 6 and 1 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 6 and 2 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 6 and 3 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 7 and 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 7 and 1 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 7 and 2 I tensorflow/core/common_runtime/gpu/gpu_device.cc:777] Peer access not supported between device ordinals 7 and 3 I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 1 2 3 4 5 6 7 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y Y Y Y N N N N I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 1: Y Y Y Y N N N N I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 2: Y Y Y Y N N N N I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 3: Y Y Y Y N N N N I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 4: N N N N Y Y Y Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 5: N N N N Y Y Y Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 6: N N N N Y Y Y Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 7: N N N N Y Y Y Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla M40 24GB, pci bus id: 0000:04:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: Tesla M40 24GB, pci bus id: 0000:05:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:2) -> (device: 2, name: Tesla M40 24GB, pci bus id: 0000:08:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:3) -> (device: 3, name: Tesla M40 24GB, pci bus id: 0000:09:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:4) -> (device: 4, name: Tesla M40 24GB, pci bus id: 0000:83:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:5) -> (device: 5, name: Tesla M40 24GB, pci bus id: 0000:84:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:6) -> (device: 6, name: Tesla M40 24GB, pci bus id: 0000:87:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:7) -> (device: 7, name: Tesla M40 24GB, pci bus id: 0000:88:00.0) Creating vocab... After first pass of data, max word length is: 21 Token count: train 929589, val 73760, test 82430 Loading vocab... Word vocab size: 10001, Char vocab size: 51 Reshaping tensors... Traceback (most recent call last): File "main.py", line 66, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 57, in main data_dir=FLAGS.data_dir) File "/home/danish/trycode/lstm-char-cnn-tensorflow-master/models/LSTMTDNN.py", line 78, in init self.loader = BatchLoader(self.data_dir, self.dataset_name, self.batch_size, self.seq_length, self.max_word_length) File "/home/danish/trycode/lstm-char-cnn-tensorflow-master/batch_loader.py", line 49, in init data = data[: batch_size * seq_length * math.floor(length / (batch_size * seq_length))] TypeError: slice indices must be integers or None or have an index method

    opened by sdabuk 4
Owner
Taehoon Kim
ex OpenAI
Taehoon Kim
Add-on for importing and auto setup of character creator 3 character exports.

CC3 Blender Tools An add-on for importing and automatically setting up materials for Character Creator 3 character exports. Using Blender in the Chara

null 260 Jan 5, 2023
Indonesian Car License Plate Character Recognition using Tensorflow, Keras and OpenCV.

Monopol Indonesian Car License Plate (Indonesia Mobil Nomor Polisi) Character Recognition using Tensorflow, Keras and OpenCV. Background This applicat

Jayaku Briliantio 3 Apr 7, 2022
Implementation of character based convolutional neural network

Character Based CNN This repo contains a PyTorch implementation of a character-level convolutional neural network for text classification. The model a

Ahmed BESBES 248 Nov 21, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
a reccurrent neural netowrk that when trained on a peice of text and fed a starting prompt will write its on 250 character text using LSTM layers

RNN-Playwrite a reccurrent neural netowrk that when trained on a peice of text and fed a starting prompt will write its on 250 character text using LS

Arno Barton 1 Oct 29, 2021
PyTorch implementation of CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition

PyTorch implementation of CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition The unofficial code of CDistNet. Now, we ha

null 25 Jul 20, 2022
Simple Tensorflow implementation of "Adaptive Convolutions for Structure-Aware Style Transfer" (CVPR 2021)

AdaConv β€” Simple TensorFlow Implementation [Paper] : Adaptive Convolutions for Structure-Aware Style Transfer (CVPR 2021) Note This repository does no

Junho Kim 26 Nov 18, 2022
This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).

The Neural Process Family This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CN

DeepMind 892 Dec 28, 2022
πŸ“ Wrapper library for text generation / language models at char and word level with RNN in TensorFlow

tensorlm Generate Shakespeare poems with 4 lines of code. Installation tensorlm is written in / for Python 3.4+ and TensorFlow 1.1+ pip3 install tenso

Kilian Batzner 63 May 22, 2021
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context Code in both PyTorch and TensorFlow

Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context This repository contains the code in both PyTorch and TensorFlow for our paper

Zhilin Yang 3.3k Jan 6, 2023
CharacterGAN: Few-Shot Keypoint Character Animation and Reposing

CharacterGAN Implementation of the paper "CharacterGAN: Few-Shot Keypoint Character Animation and Reposing" by Tobias Hinz, Matthew Fisher, Oliver Wan

Tobias Hinz 181 Dec 27, 2022
Character Controllers using Motion VAEs

Character Controllers using Motion VAEs This repo is the codebase for the SIGGRAPH 2020 paper with the title above. Please find the paper and demo at

Electronic Arts 165 Jan 3, 2023
GeneralOCR is open source Optical Character Recognition based on PyTorch.

Introduction GeneralOCR is open source Optical Character Recognition based on PyTorch. It makes a fidelity and useful tool to implement SOTA models on

null 57 Dec 29, 2022
An addon uses SMPL's poses and global translation to drive cartoon character in Blender.

Blender addon for driving character The addon drives the cartoon character by passing SMPL's poses and global translation into model's armature in Ble

ηŠΉεœ¨ι•œδΈ­ 153 Dec 14, 2022
Scripts and a shader to get you started on setting up an exported Koikatsu character in Blender.

KK Blender Shader Pack A plugin and a shader to get you started with setting up an exported Koikatsu character in Blender. The plugin is a Blender add

null 166 Jan 1, 2023
Character-Input - Create a program that asks the user to enter their name and their age

Character-Input Create a program that asks the user to enter their name and thei

PyLaboratory 0 Feb 6, 2022
This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your username and app/website.

PasswordGeneratorAndVault This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your us

Chris 1 Feb 26, 2022
PyTorch implementation of "Representing Shape Collections with Alignment-Aware Linear Models" paper.

deep-linear-shapes PyTorch implementation of "Representing Shape Collections with Alignment-Aware Linear Models" paper. If you find this code useful i

Romain Loiseau 27 Sep 24, 2022