Colab unexpectedly gets stuck and hangs after executing input() function - google-colaboratory

Colab unexpectedly gets stuck and hangs after executing input() function (Python), e.g.: input("What is your name? "). see attached file. I am using Colab free version.
Please advice, what can be done? Thanks in advance!
After Google Colab gets stuck and hangs the only thing to do is to interrupt execution and re-run the cell

Related

How to autosave notebooks in Google colab?

I was recently working in a notebook on Google Colab and my computer ran out of battery and died. All the progress I had made was not saved anywhere!
I'm very used to having jupyter notebooks, which saves my files pretty much every time I execute a cell.
Is there a way to have an equivalent feature in Google Colab?
Autosave is already implemented in Google Colab, but there is a certain delay between the moment you execute a cell and when the save occurs.
You can try this yourself by going into File>Revision History, executing a cell, and waiting for the list to refresh.
That being said, I have also experienced loss of data in the past, which I can't explain. It might be a glitch.
As a good practice, I try to save every time I remember.
Good luck.
Autosave every 60 seconds by running this "magic command" into a new code cell :
%autosave 60
Colab will confirm it when you run the cell with printing : "Autosave changes every 60 seconds"
To display the list of all magic commands you can use the command :
%lsmagic
Additionally, you can call the Quick Reference Guide, describing all the magic commands and what they do using the command :
%quickref
Enjoy!

TensorBoard doesn't do anything upon execution

Whenever I execute TensorBoard I just get:
Starting TensorBoard 54 at http://localhost:6006
(Press CTRL+C to quit)
and then nothing happens. Any advice on how to get the graph to show?
EDIT: Sorry I meant to clarify that I copy and paste "http://localhost:6006" into my browser and "No scalar data was found" appears.
FIXED: I was not typing the correct log directory. For anyone in the future who has this problem, don't be like me and assume that TensorBoard automatically reads through the /tmp directory.
One possible reason might be not giving the correct log directory, and at other times people often forget to write back summaries.

Why phantomjs script is killed automatically in between script execution?

I am trying to do web scraping using phantomJs. I am doing recurring task in that script so same script runs around 10k times with different parameters in single execution. It would take around 3 hours to complete process.
The issue is, it suddenly stops at random point with killed status written on the screen.
I tried some of the tricks to solve it but nothing worked.
Like - Tried localStorage.clear() in page.evaluate() function,
Reinstalling Phantom Js
So I need to know why it is happening and what can I do to fix it.

Read Output From A Running Process Realtime (Command Prompt)

I have been researching for an answer for my question for a long while using Google and changing what words I use in-case I find my answer, I have had no luck.
What I want is to the read the output from a process in real-time, not when it finishes the command it has been given. I have a command that I use which doesn't end unless the user ends it manually, closes the form or an error occurs. So every timer interval I would like to read the output from the command prompt (process).
I use background workers to start the process so it doesn't interfere with the form if that is any help.
Thanks in advance.

Running GLORP tests

I am trying to get GLORP into the pharo 2.0 image. I managed to load GLORP , PostgresV2 driver and then changed the GlorpDatabaseLoginResource default login params. After that, i started running the tests starting with PostgresV2 tests TestPGConnection in this i got 2 failures testFieldConverter2 and testFieldConverter3.
after i ran the GlorpTest. here i got only 353 out of 674 tests passed. Is this normal? I am running the test using the testRunner. Any idea where i could have taken a possible bad step?
Thanks in Advance.
I got all test correct now. The probelm was in the image i was checking the DateAndTime offset: method was modified somehow (may be installing some other packages did that). So that was causing my Date And time related functions to fail. After i loaded all to a fresh image and ran it was like a fine piece of cake. :)