renmengye / revnet-public

Code for "The Reversible Residual Network: Backpropagation Without Storing Activations"
MIT License
350 stars 50 forks source link

Config error #5

Open SilviaLauraPintea opened 5 years ago

SilviaLauraPintea commented 5 years ago

Hi,

I have downloaded the cifar-10 dataset using the setup.sh and now I am trying to run the model:

run_cifar_train.py --dataset cifar-10 --model revnet-38 And I get the error:

I3264 2018-10-25 11:22:17.457352 ...ifar_train.py:146 Config: {'init_filter': 3, 'disp_iter': 100, 'div255': True, 'relu_leakiness': False, 'num_channel': 3, 'seed': 0, 'whiten': }
I3264 2018-10-25 11:22:17.587692 ...ifar_train.py:156 Setting tensorflow random seed=0
I3264 2018-10-25 11:22:17.597239 ...cifar_train.py:74 Building models
I3264 2018-10-25 11:22:17.615701 ...del_factory.py:57 Batch size is set to 100
Traceback (most recent call last):
  File "run_cifar_train.py", line 283, in <module>
    main()
  File "run_cifar_train.py", line 278, in main
    logs_folder=logs_folder)
  File "run_cifar_train.py", line 158, in train_model
    m, mvalid = _get_models(config)
  File "run_cifar_train.py", line 83, in _get_models
    batch_size=config.batch_size)
  File "/tudelft.net/staff-bulk/ewi/insy/VisionLab/spintea/work/revnet/resnet/models/model_factory.py", line 90, in get_model
    apply_grad=True)
  File "/tudelft.net/staff-bulk/ewi/insy/VisionLab/spintea/work/revnet/resnet/models/model_factory.py", line 63, in _get_model
    return MODEL_REGISTRY[key](*args, **kwargs)
  File "/tudelft.net/staff-bulk/ewi/insy/VisionLab/spintea/work/revnet/resnet/models/revnet_model.py", line 33, in __init__
    dd = config.__dict__
AttributeError: 'X' object has no attribute '__dict__'

Can you please indicate what am I doing wrong. It seems there is some problem with the config of the revnet-38.

Thanks a lot. Peace, Silvia

aidangomez commented 5 years ago

Hi Silvia,

Which version of Python are you using? I'm pretty sure every object in python has a __dict__ attribute, so this is very confusing indeed.

Peace, Aidan

SilviaLauraPintea commented 5 years ago

Hi,

Thanks a lot for the fast reply. It does seem indeed to be a python related problem and not related to your code. But I have not managed to solve it yet. I have tried the code on two machines. On the one giving the above error I have: Python 2.7.5 On the second machine, the code runs without problems, and there the python version is: Python 2.7.12 Both of them have tensorflow 1.11.0 installed.

Thanks a lot for the reply. I will look more into it. Peace, Silvia

SilviaLauraPintea commented 5 years ago

Hi,

Just a note for maybe other people who stumble upon this: The solution I found is using: ._asdict() instead of .__dict__.

Peace, Silvia