Skip to content

[Bug] AttributeError: 'SimpleCustomGP' object has no attribute 'num_outputs' #354

Closed
@aleczhanshi

Description

@aleczhanshi

🐛 Bug

As I was trying to run the first code example in the tutorial (using botorch with ax), I got an error AttributeError: 'SimpleCustomGP' object has no attribute 'num_outputs'. Could anyone explain to me why this would happen?

Here's my versions of dependencies:
python 3.7.4
gpytorch 1.0.4
scipy

** Stack trace/error message **
Running optimization batch 1/5...
Traceback (most recent call last):
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 342, in getattr
return super().getattribute(name)
AttributeError: 'SimpleCustomGP' object has no attribute '_num_outputs'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 342, in getattr
return super().getattribute(name)
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/botorch/models/gpytorch.py", line 102, in num_outputs
return self._num_outputs
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 344, in getattr
raise e
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 339, in getattr
return super().getattr(name)
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 576, in getattr
type(self).name, name))
AttributeError: 'SimpleCustomGP' object has no attribute '_num_outputs'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bo_ax.py", line 84, in
batch = exp.new_trial(generator_run=model.gen(1))
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/ax/modelbridge/base.py", line 609, in gen
model_gen_options=model_gen_options,
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/ax/modelbridge/array.py", line 212, in _gen
target_fidelities=target_fidelities,
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/ax/modelbridge/torch.py", line 214, in _model_gen
target_fidelities=target_fidelities,
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/ax/models/torch/botorch.py", line 334, in gen
outcome_constraints=outcome_constraints,
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/ax/models/torch/utils.py", line 178, in subset_model
if len(idcs) == model.num_outputs:
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 344, in getattr
raise e
File "/home/aleczshi/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 339, in getattr
return super().getattr(name)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions