fluid.layers.gaussian_random(shape=shape)出错:ValueError: vector::reserve
Created by: OleNet
运行如下代码的时候,程序会报错:
shape = paddle.fluid.layers.shape(embedded)
d = fluid.layers.gaussian_random(shape=shape)
Device count: 8
Num train examples: 50
Max train steps: 3
Num warmup steps: 0
2020-02-20 00:43:16,463-WARNING: paddle.fluid.layers.py_reader() may be deprecated in the near future. Please use paddle.fluid.io.DataLoader.from_generator() instead.
I0220 00:43:16.463838 71266 pybind.cc:967] init_lod_tensor_blocking_queue
Traceback (most recent call last):
File "run_classifier.py", line 525, in <module>
main(args)
File "run_classifier.py", line 146, in main
adv=args.adv)
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/finetune/classifier.py", line 198, in create_model
return_d=True)
File "./attacktext/attacktext/adv_vat.py", line 47, in vatm
d = fluid.layers.gaussian_random(shape=shape)
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/package/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py", line 9621, in gaussian_random
'use_mkldnn': False
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/package/python/lib/python2.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/package/python/lib/python2.7/site-packages/paddle/fluid/framework.py", line 2528, in append_op
attrs=kwargs.get("attrs", None))
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/package/python/lib/python2.7/site-packages/paddle/fluid/framework.py", line 1878, in __init__
self._update_desc_attr(attr_name, attr_val)
File "/ssd1//workfiles/representation_learning/ernie/ernie.albert.icode/baidu/nlp-ernie/ernie/ERNIE/package/python/lib/python2.7/site-packages/paddle/fluid/framework.py", line 2053, in _update_desc_attr
self.desc._set_attr(name, val)
ValueError: vector::reserve