When I try to change my original Model to Jit version, I encountered with this problem.
File “train_Kinetics.py”, line 245, in 
tuple(torch.rand(opt.batch_size, model.module.channels[layer + 1], model.module.input_size[layer], model.module.input_size[layer]) for layer in range(model.module.RNN_layer))))
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/jit/init.py”, line 635, in trace
var_lookup_fn, _force_outplace)
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 487, in call
result = self._slow_forward(*input, **kwargs)
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 477, in _slow_forward
result = self.forward(*input, **kwargs)
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 142, in forward
replicas = self.replicate(self.module, self.device_ids[:len(inputs)])
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py”, line 147, in replicate
return replicate(module, device_ids)
File “/home/poli/anaconda2/envs/pytorch1.0/lib/python2.7/site-packages/torch/nn/parallel/replicate.py”, line 29, in replicate
replica = module.new(type(module))
TypeError: pybind11_object.new(TopLevelTracedModule) is not safe, use object.new()
line 245 in train_kinetics.py is:
model_traced = jit.trace(model,
(torch.rand(opt.batch_size, opt.frame_num + 2, 3, opt.img_size, opt.img_size),
tuple(torch.rand(opt.batch_size, model.module.channels[layer + 1], model.module.input_size[layer], model.module.input_size[layer])
for layer in range(model.module.RNN_layer))))