Running code cells sequentially in google colab

…衆ロ難τιáo~ 提交于 2021-01-28 00:40:18

问题


I want to run the code cells in Google Colab in sequence.

For example:

Cell[1]

from catboost import CatBoostRegressor
#do something here

Cell[2]

clf = CatBoostRegressor(task_type='GPU')
#do some more things here

But when I select "Run all" all cells seem to run in parallel, so my code does not work.

When I do the same thing in a Kaggle Kernel it runs perfectly i.e, first cell[1] is executed, and then cell[2] and so on.

I have tried searching for this in Google Colab but failed to come up with an answer.


回答1:


To run all cells at a time just press ctrl+F9 or go to runtime menu on top and click run all option and all cells run at a time.

If you want to run one by one then just go to runtime menu on top and click run after option and all cells run one by one. Note one thing that if you want to run from top cell then place cursor on top cell and then start.




回答2:


Run all does indeed run cells sequentially, e.g.,

Can you share a self-contained notebook that reproduces the problem you observe? I suspect the issue is something other than sequential execution.



来源:https://stackoverflow.com/questions/55134768/running-code-cells-sequentially-in-google-colab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!