Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Terminal Window to Jupyter Cells so all Colab users (free and pro) can train with Nerfstudio #2870

Merged
merged 20 commits into from
Mar 1, 2024

Conversation

AntonioMacaronio
Copy link
Contributor

@AntonioMacaronio AntonioMacaronio commented Feb 4, 2024

Background and Issues:

The culprit of this bug is that as of Feb 2024, Google Colab runs python 3.10, which has an issue with nerfstudio's rich console outputs. In particular, a python module called shutil will set the terminal size to 0 when dealing with rich console outputs. As a result, nothing gets printed, and Colab will shutdown the cell and terminate early before training can begin.

This is mentioned in other python modules which use the rich console output, and a complete breakdown on the issue is detailed here.

Overview of Changes

  • By using the colab-xterm module, we are able to create a terminal window in a jupyter cell output.
  • After installing it, we clear the cell output to make it very user-friendly to follow the instructions.
  • The command is printed and instructions are given to help the user run ns-train and they will be able to generate the viser/viewer link to see the training progress
  • Removed the "Connecting to Viewer Cell" as users can simply use ns-train's sharable URL link
  • Final change was to add the torchaudio dependency which was mentioned here so that users can train.

Impact and Other Notes

  • While Pro Colab users can get around this by running ns-train in their terminal window, Colab only allows for 1 terminal window. Therefore, to run the render command, pro users need to Ctrl+C the training process hosting the viser/viewer link, which can be quite irritating - especially if they want to make more than just 1 render path.

  • Therefore, even once Colab upgrades to python 3.11 in April 2024, there is still a need to have at least 2 terminal windows, which is possible with this change.

  • To run ns-train, users (free and pro) simply need to follow the instructions to copy and paste the command into the terminal window. This is pretty clear to follow, and looks like the following:

image
  • Below is what the cell terminal window looks like after copy+pasting the command on a free colab account:
image

@AntonioMacaronio AntonioMacaronio marked this pull request as ready for review February 4, 2024 11:33
@AntonioMacaronio AntonioMacaronio changed the title Adding Terminal Window to Jupyter Cells for all Colab users (free and pro) to train with nerfstudio Adding Terminal Window to Jupyter Cells so all Colab users (free and pro) can train with Nerfstudio Feb 4, 2024
@jfenton888
Copy link

Just found this as a fix to my own issue with getting the colab notebook to work. This does look to be working (I'm currently at 5% trained on one of the demo scenes), but I did notice you had a little error in the imports. There is now an extra " on the end of an import line. Just wanted to point this out and the non-blocking error it causes before you try to merge this

Screenshot 2024-02-05 at 11 23 24 AM

@AntonioMacaronio
Copy link
Contributor Author

@jfenton888 thank you for the catch! I've updated the PR with this change

@ginazhouhuiwu
Copy link
Contributor

ginazhouhuiwu commented Feb 6, 2024

Thank you!!! Going to test this soon and see if anything is needed, but it looks like everything is good!

Copy link
Contributor

@ginazhouhuiwu ginazhouhuiwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seemed good to me, sorry for the delay and thank you again!!

@brentyi brentyi enabled auto-merge (squash) March 1, 2024 06:33
@brentyi brentyi merged commit 56d1d19 into nerfstudio-project:main Mar 1, 2024
2 checks passed
Michael-Spleenlab pushed a commit to Michael-Spleenlab/nerfstudio that referenced this pull request Apr 26, 2024
…pro) can train with Nerfstudio (nerfstudio-project#2870)

* adding terminal window to jupyter cells for free colab users to train and render

* updating torchaudio package dependency

* deleting viewer connection cell, replaced with ns-train's sharable URL viewer link

* fixing flying apostrophe

* fixing pip torch download installation typo

---------

Co-authored-by: Gina Wu <42229107+ginazhouhuiwu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants