Search code examples
python-3.xtensorflowmachine-learningludwig

TypeError: 'Tensor' object is not callable Ludwig Uber


I'm new to Uber Ludwig, an I'm getting the error in the Title, The StackTrace is:

Epoch   1
Training: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:56<00:00,  1.76it/s]
Traceback (most recent call last):
  File "/usr/local/bin/ludwig", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/ludwig/cli.py", line 108, in main
    CLI()
  File "/usr/local/lib/python3.7/dist-packages/ludwig/cli.py", line 64, in __init__
    getattr(self, args.command)()
  File "/usr/local/lib/python3.7/dist-packages/ludwig/cli.py", line 69, in experiment
    experiment.cli(sys.argv[2:])
  File "/usr/local/lib/python3.7/dist-packages/ludwig/experiment.py", line 472, in cli
    experiment(**vars(args))
  File "/usr/local/lib/python3.7/dist-packages/ludwig/experiment.py", line 203, in experiment
    **kwargs
  File "/usr/local/lib/python3.7/dist-packages/ludwig/train.py", line 311, in full_train
    debug=debug
  File "/usr/local/lib/python3.7/dist-packages/ludwig/train.py", line 475, in train
    **model_definition['training']
  File "/usr/local/lib/python3.7/dist-packages/ludwig/models/model.py", line 576, in train
    bucketing_field
TypeError: 'Tensor' object is not callable

So I have a CSV file with data in the following format:

elo\\,evaluation
1063\\,"12\\, 30\\, 16\\, 2\\, 17\\, 28\\, 1\\, 5\\, 7\\, 0\\, 39\\, 0"
1034\\,"18\\, 13\\, 13\\, 1\\, 8\\, 20\\, 35\\, 0\\, 20\\, 11\\, 8\\, 9"
1713\\,"23\\, 13\\, 26\\, 35\\, 36\\, 33\\, 14\\, 20\\, 7\\, 11\\, 1\\, 3\\, 5\\, 14\\, 16\\, 2\\, 6\\, 19\\, 60\\, 193\\, 58\\, 100\\, 82\\, 24\\, 2985\\, 1\\, 230\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0"
1812\\,"1\\, 2\\, 53\\, 3\\, 66\\, 5\\, 14\\, 8\\, 56\\, 29\\, 7\\, 30\\, 14\\, 15\\, 10\\, 14\\, 4\\, 34\\, 1\\, 22\\, 15\\, 26\\, 133\\, 6\\, 59\\, 0\\, 257\\, 553\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0"
1718\\,"21\\, 83\\, 23\\, 6\\, 93\\, 8\\, 26\\, 25\\, 19\\, 12\\, 21\\, 23\\, 10\\, 5\\, 6\\, 12\\, 6\\, 11\\, 7\\, 38\\, 0\\, 3\\, 33\\, 18\\, 11\\, 6\\, 22\\, 14\\, 21\\, 6\\, 19\\, 13\\, 8\\, 0\\, 4158\\, 0\\, 5\\, 1\\, 0\\, 1\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0"
1743\\,"4\\, 17\\, 22\\, 25\\, 36\\, 7\\, 63\\, 5\\, 4\\, 11\\, 26\\, 12\\, 0\\, 17\\, 3\\, 2\\, 10\\, 16\\, 3\\, 19\\, 17\\, 13\\, 2\\, 5\\, 49\\, 40\\, 7\\, 1\\, 42\\, 10\\, 2\\, 36\\, 48\\, 8\\, 1175\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0\\, 0"

Now my Model definition is:

input_features:
  -
    name: evaluation
    type: sequence
output_features:
  -
    name: elo
    type: numerical

and the command I run on cli:

ludwig experiment --data_csv evaluated.csv --model_definition_file modelDefinition.yml --output_directory results

Now I have no idea whats why the error occurs can someone help me?


Solution

  • As evaluation is protected keyword in ludwig try changing the name of input feature to something other than evaluation.