问题描述
我尝试/捕获了 google colab 上 autosklearn 的导入错误,我需要做白痴证明,我的意思是,非常清楚地给出每个细节,并控制所有期望等等。由于一旦安装了运行时需要重新启动,我需要给出消息,所以这里是我的代码:
#from exceptions import TypeError
try:
import autosklearn
print('autosklearn: %s' % autosklearn.__version__)
except ImportError as e:
print("ERROR:",e)
print(' Installling autosklearn ')
!sudo apt-get install build-essential swig
!curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
!pip install auto-sklearn
print(' Now you should restart Runtime ( menu -> Restart Runtime) ')
assert False
except Exception as e:
print("Exception:",e)
print(' Probably ... you should restart Runtime ( menu -> Restart Runtime) ')
assert False
raise SystemExit("Stop right there!")
我同时尝试断言 False 和引发系统退出,但一个给我 AssertionError,另一个只是停止那个单元格执行并继续下一个
解决方法:确保我可以创建一个函数,它带有 if 进入无效指令 [print(undefinedVar)] 并在每个单元格中调用此函数,但对我来说似乎很脏
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)