www0wwwjs1 / Matrix-Capsules-EM-Tensorflow

A Tensorflow implementation of CapsNet based on paper Matrix Capsules with EM Routing
Apache License 2.0
218 stars 83 forks source link

Is there Something to be done after running download.sh for smallNORB data to be available? #40

Open moriyas1984 opened 6 years ago

moriyas1984 commented 6 years ago

I run ./download.sh under ./data and then the directory smallNORB and 4 files smallnorb-xxxx-{testing|training}-{cat|dat}.mat got available. But when I tried to train the network with the smallNORB dataset by sending the command python train.py "smallNORB", errors as follows returned.

$ python3 train.py "smallNORB"
Using TensorFlow backend.
2018-08-07 19:49:45,984 [5964] INFO     __main__: Using dataset: smallNORB
2018-08-07 19:49:45,990 [5964] CRITICAL root: Traceback (most recent call last):
  File "train.py", line 156, in <module>
    tf.app.run()
  File "/home/user/python3.6/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "train.py", line 52, in main
    batch_x, batch_labels = create_inputs()
  File "/path/to/Matrix-Capsules-EM-Tensorflow/config.py", line 84, in <lambda>
    'smallNORB': lambda: create_inputs_norb(is_train, epochs),
  File "/path/to/Matrix-Capsules-EM-Tensorflow/utils.py", line 31, in create_inputs_norb
    image, label = norb.read_norb_tfrecord(chunk_files, epochs)
  File "/path/to/Matrix-Capsules-EM-Tensorflow/data/smallNORB.py", line 128, in read_norb_tfrecord
    filename_queue = tf.train.string_input_producer(filenames, num_epochs=epochs)
  File "/home/user/python3.6/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 241, in string_input_producer
    raise ValueError(not_null_err)
ValueError: string_input_producer requires a non-null input tensor

Did I miss anything to do before training with smallNORB? I think the 4 files downloaded should be converted tfrecord files.

I'm a begginer of tensorflow so what I said maybe beside the point...

Thanks.

lithostark commented 6 years ago

Hi, I'm having exactly the same problem. Any solutions please?

zhaolei0413 commented 5 years ago

嗨,我也遇到了 相同的问题,请问有解决吗

yhyu13 commented 5 years ago

I believe python smallNORB.py tfrecord to generate tfrecord files (tensorflow multi-thread I/O files) from raw data.

zhaolei0413 commented 5 years ago

I believe python smallNORB.py tfrecord to generate tfrecord files (tensorflow multi-thread I/O files) from raw data.

Thank you very much for your reply. But after I ran your code “python3 smallNORB.py tfrecord” , there were new errors. CRITICAL root: Traceback (most recent call last): File "smallNORB.py", line 210, in argh.dispatch(parser) File "/home/ailab/.local/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch for line in lines: File "/home/ailab/.local/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command for line in result: File "/home/ailab/.local/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call result = function(*positional, **keywords) File "smallNORB.py", line 115, in tfrecord write_data_to_tfrecord(kind='train', chunkify=False) File "smallNORB.py", line 86, in write_data_to_tfrecord images = images[perm] MemoryError After I tried to allocate 6G memory to the virtual machine, it was still a mistake. Do you know the solution?

yhyu13 commented 5 years ago

@zhaolei0413 Try to allocate as much memory to the VM as possible, 6G might not be enough since it still shows "MemoryError".

zhaolei0413 commented 5 years ago

我相信python smallNORB.py tfrecord从原始数据生成tfrecord文件(tensorflow多线程I / O文件)。

当我尝试这个时,我收到以下错误: FileNotFoundError: [Errno 2] No such file or directory: './smallNORB/smallnorb-5 x46789x9x18x6x2x96x96-training-dat.mat' You downloaded less smallNORB files. You can download them from my link and extract them into the data directory. 链接: https://pan.baidu.com/s/1_AmFIG8hagZMgevvK8wPmQ 提取码: rcd1