Closed ericdoug-qi closed 3 years ago
/opt/conda/lib/python3.7/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) Traceback (most recent call last): File "run_element_extract.py", line 277, in main() File "run_element_extract.py", line 234, in main trainer.build_model(model_fn=get_model_fn(config, args)) File "/opt/tfbert/tfbert/trainer.py", line 621, in build_model model_output = model_fn(inputs, True) File "run_element_extract.py", line 126, in model_fn inputs File "/opt/tfbert/tfbert/models/for_task.py", line 173, in init compute_type=compute_type File "/opt/tfbert/tfbert/models/bert.py", line 152, in init** input_shape = model_utils.get_shape_list(input_ids, expected_rank=2) File "/opt/tfbert/tfbert/models/model_utils.py", line 196, in get_shape_list assert_rank(tensor, expected_rank, name) File "/opt/tfbert/tfbert/models/model_utils.py", line 241, in assert_rank (name, scope_name, actual_rank, str(tensor.shape), str(expected_rank))) ValueError: For the tensor
IteratorGetNext:1
in scope`, the actual rank
1(shape = (?,)) is not equal to the expected rank
Sorry, there was an error in the previous data processing. It has been fixed in the new code.
Yes, Thanks for your fix timely.
/opt/conda/lib/python3.7/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) Traceback (most recent call last): File "run_element_extract.py", line 277, in
main()
File "run_element_extract.py", line 234, in main
trainer.build_model(model_fn=get_model_fn(config, args))
File "/opt/tfbert/tfbert/trainer.py", line 621, in build_model
model_output = model_fn(inputs, True)
File "run_element_extract.py", line 126, in model_fn
**inputs
File "/opt/tfbert/tfbert/models/for_task.py", line 173, in init
compute_type=compute_type
File "/opt/tfbert/tfbert/models/bert.py", line 152, in init
input_shape = model_utils.get_shape_list(input_ids, expected_rank=2)
File "/opt/tfbert/tfbert/models/model_utils.py", line 196, in get_shape_list
assert_rank(tensor, expected_rank, name)
File "/opt/tfbert/tfbert/models/model_utils.py", line 241, in assert_rank
(name, scope_name, actual_rank, str(tensor.shape), str(expected_rank)))
ValueError: For the tensor
IteratorGetNext:1
in scope`, the actual rank
1(shape = (?,)) is not equal to the expected rank