Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Not Compiling #10

Open
liaq192 opened this issue Jun 29, 2018 · 5 comments
Open

Project Not Compiling #10

liaq192 opened this issue Jun 29, 2018 · 5 comments

Comments

@liaq192
Copy link

liaq192 commented Jun 29, 2018

when i try to compile using
python vsum_train.py --dataset datasets/eccv16_dataset_tvsum_google_pool5.h5 --max-epochs 60 --hidden-dim 256

It gives following error

python vsum_train.py --dataset datasets/eccv16_dataset_tvsum_google_pool5.h5 --max-epochs 60 --hidden-dim 256

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
[29/06/2018 08:46:03] model options: {'disp_freq': 1, 'optimizer': 'adam', 'regularizer': 'L2', 'U_init': 'normal', 'base_lr': 1e-05, 'train_dataset_path': 'datasets/eccv16_dataset_tvsum_google_pool5.h5', 'alpha': 0.01, 'max_epochs': 60, 'W_init': 'normal', 'weight_decay': 1e-05, 'distant_sim_thre': 20, 'ignore_distant_sim': False, 'decay_stepsize': -1, 'model_file': None, 'decay_rate': 0.1, 'hidden_dim': 256, 'input_dim': 1024, 'n_episodes': 5}
[29/06/2018 08:46:03] initializing net model
Traceback (most recent call last):
File "vsum_train.py", line 158, in
train_dataset_path=args.dataset)
File "vsum_train.py", line 56, in train
net = reinforceRNN(model_options)
File "/home/ssong/campTest1/vsumm-reinforce/model_reinforceRNN.py", line 40, in init
init_state=None, init_memory=None, go_backwards=False
File "/home/ssong/campTest1/vsumm-reinforce/theano_nets.py", line 342, in init
self.output = self.step(self.state_below)
File "/home/ssong/campTest1/vsumm-reinforce/theano_nets.py", line 396, in step
go_backwards=self.go_backwards
File "/home/ssong/.local/lib/python2.7/site-packages/theano/scan_module/scan.py", line 1077, in scan
scan_outs = local_op(*scan_inputs)
File "/home/ssong/.local/lib/python2.7/site-packages/theano/gof/op.py", line 615, in call
node = self.make_node(*inputs, **kwargs)
File "/home/ssong/.local/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 546, in make_node
inner_sitsot_out.type.dtype))
ValueError: When compiling the inner function of scan the following error has been encountered: The initial state (outputs_info in scan nomenclature) of variable IncSubtensor{Set;:int64:}.0 (argument number 1) has dtype float32, while the result of the inner function (fn) has dtype float64. This can happen if the inner function of scan results in an upcast or downcast.

using following python version
Python 2.7.12

@KaiyangZhou
Copy link
Owner

It says the dtype is supposed to be float32 but found float64. You need to change the global config to floatX = float32.

@liaq192
Copy link
Author

liaq192 commented Jun 29, 2018

python vsum_train.py --dataset datasets/eccv16_dataset_tvsum_google_pool5.h5 --max-epochs 60 --hidden-dim 256
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
[29/06/2018 02:57:38] model options: {'disp_freq': 1, 'optimizer': 'adam', 'regularizer': 'L2', 'U_init': 'normal', 'base_lr': 1e-05, 'train_dataset_path': 'datasets/eccv16_dataset_tvsum_google_pool5.h5', 'alpha': 0.01, 'max_epochs': 60, 'W_init': 'normal', 'weight_decay': 1e-05, 'distant_sim_thre': 20, 'ignore_distant_sim': False, 'decay_stepsize': -1, 'model_file': None, 'decay_rate': 0.1, 'hidden_dim': 256, 'input_dim': 1024, 'n_episodes': 5}
[29/06/2018 02:57:38] initializing net model
Traceback (most recent call last):
File "vsum_train.py", line 158, in
train_dataset_path=args.dataset)
File "vsum_train.py", line 56, in train
net = reinforceRNN(model_options)
File "/home/ssong/campTest1/vsumm-reinforce/model_reinforceRNN.py", line 110, in init
grads = [T.grad(cost=cost, wrt=p) for p in self.params]
File "/home/ssong/.local/lib/python2.7/site-packages/theano/gradient.py", line 611, in grad
rval[i].type.why_null)
theano.gradient.NullTypeGradError: tensor.grad encountered a NaN. This variable is Null because the grad method for input 0 (Reshape{2}.0) of the UndefinedGrad op is mathematically undefined.

@KaiyangZhou
Copy link
Owner

you need to use theano 0.9.

i suggest using the pytorch version, which requires less efforts in configuration.

@liaq192
Copy link
Author

liaq192 commented Jun 29, 2018

Hi ,
Can u add some config details in readme about the packages u have used and version that can help me and other users to configure this project easily .
( it may be obvious for some users but for someone like me would be very helpful) .

@XChuanLee
Copy link

Hi!
I met the same problem, have you solved it?
using following version:
python: 2.7.12
theano:0.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants