Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Colab code change always produces "TabError: Inconsistent use of tab and spaces in indentation"

When I make even a simple change in a file checked out in /root/model/ in Google Colab environment Intro, I get

"TabError: Inconsistent use of tab and spaces in indentation"

I've set the editor in Colab settings to show 4 spaces for a Tab, and to show line-numbers (the Colab editor doesn't have many settings to change), and the line that I added looks perfectly indented. I can't tell why/how it's not indented.

Does anyone come across this issue?

How do you change files (in code that's checkout out in /content/ or /root/ from a model-repo) as the Colab-editor gives error on very basic of changes?

like image 447
Joe Black Avatar asked Oct 18 '25 17:10

Joe Black


1 Answers

I came across this issue. I have the feeling that something goes wrong from time to time when copying and pasting code lines, but I do not have a precise diagnosis.

Changing the tabs into spaces solved the issue for me.

like image 192
Vitality Avatar answered Oct 20 '25 08:10

Vitality