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
@Bharat9280 The error you're encountering suggests that there's a NoneType object that doesn't have a to_json method. This indicates that the counterfactual_obj within the counterfactual_config is None.
Try out these steps for debugging:-
Check counterfactual_config:
check that the counterfactual_config is properly instantiated and that counterfactual_obj is not None.
Validate Data:
check that the data you're using to create counterfactuals is correct and complete. Any missing or incorrect data might result in None being assigned to counterfactual_obj.
example snippet to find where None is coming:-
# Debugging the counterfactual configuration
for counterfactual_config in self._counterfactual_config_list:
if counterfactual_config.counterfactual_obj is None:
print(f"Counterfactual configuration {counterfactual_config} has a None counterfactual_obj.")
else:
serialized_counterfactual_data_list.append(
self._get_counterfactual(counterfactual_config)
)
This should help you identify if and why counterfactual_obj is None.
Hope this helps, let me know, if it works
Thanks
AttributeError Traceback (most recent call last)
/tmp/ipykernel_34754/2258094842.py in
----> 1 ResponsibleAIDashboard(rai_insights, cohort_list=cohort_list)
~/.conda/envs/response1/lib/python3.7/site-packages/raiwidgets/responsibleai_dashboard.py in init(self, analysis, public_ip, port, locale, cohort_list, **kwargs)
33 cohort_list=None, **kwargs):
34 self.input = ResponsibleAIDashboardInput(
---> 35 analysis, cohort_list=cohort_list)
36
37 super(ResponsibleAIDashboard, self).init(
~/.conda/envs/response1/lib/python3.7/site-packages/raiwidgets/responsibleai_dashboard_input.py in init(self, analysis, cohort_list)
39 model = analysis.model
40 self._is_classifier = is_classifier(model)
---> 41 self.dashboard_input = analysis.get_data()
42
43 self._validate_cohort_list(cohort_list)
~/.conda/envs/response1/lib/python3.7/site-packages/responsibleai/rai_insights/rai_insights.py in get_data(self)
497 data.errorAnalysisData = self.error_analysis.get_data()
498 data.causalAnalysisData = self.causal.get_data()
--> 499 data.counterfactualData = self.counterfactual.get_data()
500 return data
501
~/.conda/envs/response1/lib/python3.7/site-packages/responsibleai/managers/counterfactual_manager.py in get_data(self)
700 for counterfactual_config in self._counterfactual_config_list:
701 serialized_counterfactual_data_list.append(
--> 702 self._get_counterfactual(counterfactual_config))
703
704 return serialized_counterfactual_data_list
~/.conda/envs/response1/lib/python3.7/site-packages/responsibleai/managers/counterfactual_manager.py in _get_counterfactual(self, counterfactual_config, counterfactual_object)
710 if counterfactual_object is None:
711 json_data = json.loads(
--> 712 counterfactual_config.counterfactual_obj.to_json())
713 else:
714 json_data = json.loads(counterfactual_object.to_json())
AttributeError: 'NoneType' object has no attribute 'to_json'
The text was updated successfully, but these errors were encountered: