You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/anaconda3/envs/mypython39/lib/python3.9/site-packages/torch_geometric/data/dataset.py:258, in Dataset.getitem(self, idx)
248 r"""In case :obj:idx is of type integer, will return the data object
249 at index :obj:idx (and transforms it in case :obj:transform is
250 present).
251 In case :obj:idx is a slicing object, e.g., :obj:[2:5], a list, a
252 tuple, or a :obj:torch.Tensor or :obj:np.ndarray of type long or
253 bool, will return a subset of the dataset at the specified indices."""
254 if (isinstance(idx, (int, np.integer))
255 or (isinstance(idx, Tensor) and idx.dim() == 0)
256 or (isinstance(idx, np.ndarray) and np.isscalar(idx))):
--> 258 data = self.get(self.indices()[idx])
259 data = data if self.transform is None else self.transform(data)
260 return data
Cell In[8], line 68, in GraphDataset.get(self, index)
66 edge_indices = sample_observation.edge_features.indices.astype(np.int32)
67 edge_features = np.expand_dims(sample_observation.edge_features.values, axis=-1)
---> 68 variable_features = sample_observation.variable_features
70 # We note on which variables we were allowed to branch, the scores as well as the choice
71 # taken by strong branching (relative to the candidates)
72 candidates = np.array(sample_action_set, dtype=np.int32)
AttributeError: 'ecole.core.observation.NodeBipartiteObs' object has no attribute 'variable_features'`
Setting
OS: Ubuntu Linux WSL2 on Window 10
Python version: 3.9
Ecole version: not sure how to view ecole version, I just install using conda install -c conda-forge ecole
I have been able to solve this problem. Somehow this command
Does not install ecole 0.8.1 or 0.8.0 but install 0.7.3 instead. This has lead me to change all variables that have the name variable_features to column_features
Now I am trying to install 0.8.1 but I am not really successful
I have also encountered this problem. It's because the version of ecole(like 0.7.3) is too old.
You can first update your conda to the latest version(like 24.5.0) and then install 0.8.1ecole with conda install -c conda-forge ecoleor simply with conda install ecole. The latest version of conda can install 0.8.1ecole, but the old version of conda(like 23.7.4) can only install 0.7.3ecole. Hope this helps you!
Describe the bug
I run the example at https://github.com/ds4dm/ecole/blob/master/examples/branching-imitation/example.ipynb
and encounter this error 'ecole.core.observation.NodeBipartiteObs' object has no attribute 'variable_features'
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[11], line 1
----> 1 observation = train_data[0]
File ~/anaconda3/envs/mypython39/lib/python3.9/site-packages/torch_geometric/data/dataset.py:258, in Dataset.getitem(self, idx)
248 r"""In case :obj:
idx
is of type integer, will return the data object249 at index :obj:
idx
(and transforms it in case :obj:transform
is250 present).
251 In case :obj:
idx
is a slicing object, e.g., :obj:[2:5]
, a list, a252 tuple, or a :obj:
torch.Tensor
or :obj:np.ndarray
of type long or253 bool, will return a subset of the dataset at the specified indices."""
254 if (isinstance(idx, (int, np.integer))
255 or (isinstance(idx, Tensor) and idx.dim() == 0)
256 or (isinstance(idx, np.ndarray) and np.isscalar(idx))):
--> 258 data = self.get(self.indices()[idx])
259 data = data if self.transform is None else self.transform(data)
260 return data
Cell In[8], line 68, in GraphDataset.get(self, index)
66 edge_indices = sample_observation.edge_features.indices.astype(np.int32)
67 edge_features = np.expand_dims(sample_observation.edge_features.values, axis=-1)
---> 68 variable_features = sample_observation.variable_features
70 # We note on which variables we were allowed to branch, the scores as well as the choice
71 # taken by strong branching (relative to the candidates)
72 candidates = np.array(sample_action_set, dtype=np.int32)
AttributeError: 'ecole.core.observation.NodeBipartiteObs' object has no attribute 'variable_features'`
Setting
To Reproduce
Just run the jupyter notebook at https://github.com/ds4dm/ecole/blob/master/examples/branching-imitation/example.ipynb
Expected behavior
Note that the expected result should be this
The text was updated successfully, but these errors were encountered: