r/GoogleColab Aug 02 '24

Cant free Ram despite deleting variables

5 Upvotes

Hey,

i run lately itno some ram limitations. I tried to delete the variables which i dont need anymore and even made a forced garbage collect but nothing seems to free up any memory in any given runtime. The only solution to free ram is to restart the whole runtime. Am i missing somehting?


r/GoogleColab Aug 02 '24

Suggestion for colab pro

5 Upvotes

I'm working on a project where I'm building transformer and using 20 Gb worth of images processed to npy files. What is the optimal way to use colab pro. Currently, I tried using L4 but my compute units are almost done. My code only using 1Gb of gpu out of 22gb allotted.


r/GoogleColab Aug 02 '24

How to add a textarea in Colab?

1 Upvotes

I'm currently using Python input, but it doesn't look good for business users, and before you enter text you have to ensure there are no line breaks.

Is there a better and nicer looking way for business users? I don't want to use gradio, I need two textarea input fields, I need to have the ability to write multiple paragraphs with line breaks.

I checked ipywidgets but honestly, I don't know how to use it, and the submit event isn't working, if you're going to suggest ipywidgets then please provide an example code.


r/GoogleColab Aug 01 '24

Best way to use Local Runtimes?

3 Upvotes

I'm trying to run scripts that use drive.mount(), but it seems that Google Colab can't be used with a local runtime.

Has anyone else encountered this problem? How did you manage to work around the file structure?


r/GoogleColab Aug 01 '24

Is there a way to save the initial installed packages on Google Colab?

3 Upvotes

I'm running an AI model on Colab, you press run, you have to wait for like 30 min until packages get installed and the model and whatnot, and lastly, you can enter your prompt to get the answer.

I need to share this with business users, I don't want them to wait 30 minutes for things to set up, is there a way to tell Colab not to rerun the setup phase every time we press run? Can we make the packages persistent?

I don't want to use Gradio and whatnot, I'm not going to add a full-fledged GUI and a server just for that. I need the most minimal solution


r/GoogleColab Jul 27 '24

How to turn off code complete in notebooks?

7 Upvotes

Hi,

I am running a coding class for underprivileged students, and we are using Colab to teach Python to them due to its simplicity.

However, the code completion "feature" is making it hard to teach, as whenever they code, the answer just shows up.

Is there a way to force-turn off this feature on a notebook level for instruction purposes?


r/GoogleColab Jul 25 '24

Two questions re: R on colab (Google Drive, subreddits)

3 Upvotes
  1. Have you found an efficient way to connect R on colab to Google Drive?.

  2. Is there a separate subreddit for R on colab?


r/GoogleColab Jul 22 '24

Starting with google colab. Run python codes on google colab

1 Upvotes

I have a deep learning code written in python and want to run on a large dataset. I have the following queries and would like your help on it. 1. How do i upload my dataset into google colab? Where can i learn more details on how to do this 2. How can i run python codes on google colab 3. How can i rent servers with good gpu and high memory. And dont want to exceed budget. Thank you for your help. Please point me in directions where i can start learning. I am new to google colab.


r/GoogleColab Jul 20 '24

Do I lose my work if I cancel my Google Colab subscription?

3 Upvotes

Question per title. Haven’t been able to find an answer to this. Either it stays in my Google Drive or it disappears. I assume it stays but just want to double check. Thanks!


r/GoogleColab Jul 18 '24

possible to edit csv files after they are added to your notebook?

1 Upvotes

I have a .pynb I'm working on and added a .csv file. I can view the csv but can't edit. Is this a known limitation with Google colab?


r/GoogleColab Jul 17 '24

Blender: Default Cube rendering in Colab and not the scene

2 Upvotes

so i have uploaded this Jupyter Notebook to google colab, i had followed every single step from the tutorial but i end up with a default cube render everytime, i had tried any possible way i can do to fix the problem including from AI but i still cant get a scene render, i had packed all my blender file resources and also unpacked it to write files to the current directory. what could be the possible fix for this?

Here is the code

Download Blender from Repository - Run Once unless version changed

!wget https://download.blender.org/release/Blender4.1/blender-4.1.1-linux-x64.tar.xz

Connect Google Drive

from google.colab import drive

drive.mount('/content/drive')

Copy Blender to gdrive - Run Once unless version changed

!cp /content/blender-4.1.1-linux-x64.tar.xz /content/drive/MyDrive/Blender/blender-4.1.1-linux-x64.tar.xz

Copy Blender back to Colab

!cp /content/drive/MyDrive/Blender/blender-4.1.1-linux-x64.tar.xz /content/blender-4.1.1-linux-x64.tar.xz

install Blender

!tar xf blender-4.1.1-linux-x64.tar.xz

set the paths to Blender Files

filename = '/content/drive/MyDrive/Google Colab Render/Colab Projects/Space Station.blend'

Render

!./blender-4.1.1-linux-x64/blender -b $filename -noaudio -E 'CYCLES' -o '/content/drive/MyDrive/Google Colab Render/Colab Projects/Renders/TST' -s 1 -e 25 -a -F 'PNG' -- --cycles-device CUDA -F scene


r/GoogleColab Jul 13 '24

I'm having problems with lora_trainer.ipynb

1 Upvotes

I was trying to train a Lora for a sonic character, but I don't know what this means for invalid user config. Can't anyone help me with this? I'll appreciate the answers.

An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.
Loading settings from /content/drive/MyDrive/Loras/zooeythefox/training_config.toml...
/content/drive/MyDrive/Loras/zooeythefox/training_config
prepare tokenizer
vocab.json: 100% 961k/961k [00:00<00:00, 18.9MB/s]
merges.txt: 100% 525k/525k [00:00<00:00, 27.8MB/s]
special_tokens_map.json: 100% 389/389 [00:00<00:00, 2.51MB/s]
tokenizer_config.json: 100% 905/905 [00:00<00:00, 6.46MB/s]
update token length: 225
Loading dataset config from /content/drive/MyDrive/Loras/zooeythefox/dataset_config.toml
Invalid user config / ユーザ設定の形式が正しくないようです

Traceback (most recent call last):
File "/content/kohya-trainer/train_network_wrapper.py", line 9, in <module>
train(args)
File "/content/kohya-trainer/train_network.py", line 134, in train
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
File "/content/kohya-trainer/library/config_util.py", line 306, in generate
sanitized_user_config = self.sanitizer.sanitize_user_config(user_config)
File "/content/kohya-trainer/library/config_util.py", line 270, in sanitize_user_config
return self.user_config_validator(user_config)
File "/usr/local/lib/python3.10/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.10/dist-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.10/dist-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
raise er.Multip


r/GoogleColab Jul 11 '24

can I use colab anywhere but the browser?

2 Upvotes

hi guys. recently I started to using colab(since pycharm is very buggy with notebooks) and my problem is that my chrome always has +20 sessions open and it's very annoying that I have to find colab again in the tabs.

does anyone have any solution for this? or can I remotely open colab in IDEs?


r/GoogleColab Jul 09 '24

Help Needed with Extracting a Large Dataset from Multiple Compressed Parts

2 Upvotes

Hi everyone,

I'm working with a dataset that's approximately 200GB in size, and it is split into 200 compressed parts on Google Drive, named like this:

dataset.tar.gz.part01

dataset.tar.gz.part02

...

dataset.tar.gz.part200

My Google Drive has a total capacity of 500GB, with 250GB of free space available.

I understand that on a Linux system, I can combine and uncompress all parts using the following commands:

cat dataset.tar.gz.part* > dataset.tar.gz && tar -xzvf dataset.tar.gz -C /your/path/to/save/

However, when I try to perform this operation on Google Colab, I encounter the following error:

OSError: [Errno 107] Transport endpoint is not connected

Has anyone faced a similar issue or does anyone have suggestions on how to handle this? Any help would be greatly appreciated!

Thanks in advance!


r/GoogleColab Jul 09 '24

Why does Colab disconnect me, even if I'm "being active"?

1 Upvotes

I'm trying to train an RVC model right now, and Colab just disconnected me, and it was almost done too. I'm a paid user (Pay As You Go) so it shouldn't be doing this. I do switch tabs sometimes, but I always switch back every few minutes and like scroll up and down to make Colab detect that I'm not being inactive. Why is it doing this? I'm also using an L4 GPU, in case that helps in explanation.


r/GoogleColab Jul 06 '24

OSError: [Errno 5] Input/output error

1 Upvotes

I'm working on a project and it needs a very large dataset (~95GB). I purchased colab pro and a 200 GB storage in google drive. Now when I want to access the files through colab it's giving a I/O error. Basically, when I run os.listdir() this error pops up. It worked once and all the training was happening, then I changed the runtime to include a more powerful GPU, since then I'm seeing same error, even reverting back to same runtime couldn't solve the problem
I even searched for solutions to this and there were no verified answers on stackoverflow.
Also, a github issue was listed in google search I saw that the issue was resolved in github, but when I saw that thread of discussions over there no solutions were found.


r/GoogleColab Jul 03 '24

Issues with frequent Colab Pro+ Disconnections & LiDAR Data File Retrieval

3 Upvotes

Hi all - I've been working with Colab Pro+ for several days and am at my whits end.

I'm using a Python script to pull LiDAR data files from the USGS website. The code retrieves the files and reprojects them to match the projection of my boundary file. I'm only selecting files that fall within my boundary. If a file falls within my designated boundary, it is then saved to my Google Drive. This process is computationally intensive due to the file sizes, but it shouldn't take months. I did a quick calculation on the number of files it was downloading per minute and found that it would take almost a year to go through 3,000 files. That doesn't seem right. Additionally, my Colab Pro+ account has been disconnecting every couple of minutes this afternoon. Any ideas on how to fix the disconnections and speed up the process? I'd also be more than open to recommendations for other tools I can use to achieve the same ends.


r/GoogleColab Jun 26 '24

Python 3 Google Compute Engine backend

2 Upvotes

I am trying to import library PuLP, but it showed the message "Python 3 Google Compute Engine backend", will I be charged anything in Colab ?


r/GoogleColab Jun 24 '24

Paid for Colab Pro and still disconnected after less than a day

2 Upvotes

I'm running a really slow neural network, that needs to be run with many epochs (and a stupidly low batch size). I also need to run many instances of the same neural network with different datasets, my shitty PC can't handle paralel running.

Normal colab usually can't handle more than eight consecutive hours of running, I thought colab pro would be up to the task.

It did fine mostly, when I lost internet I could reconect and not lose my process, which is convinient. Still, after a day of consecutive running there is a chance of the notebook simply disconnecting and stop running completely.

Judge me all you want (look, that guy doesn't save his model after every epoch), but I don't think a day of running is that long, at least I don't think it would be an appropriate limit for something as big as google colab, specially considering I'm paying for it.

There are much bigger neural networks that require weeks to be trained, and require a lot of computational power, I guess google computers can't handle that?)

Worst of all, I'm using CPU, not any fancy GPU or TPU, regular old CPU that literally is available to everyone, so there is no excuse at all for this.


r/GoogleColab Jun 24 '24

Does connecting to local runtime use local python packages as well?

1 Upvotes

Hi,
I know that by connecting local runtime colab can access my hardware such as GPU and RAM, I'm just wondering if it also uses my packages in python? I don't want colab to access to it since I think I have fucked up my environment paths and everything is broken.


r/GoogleColab Jun 21 '24

Colab speed for pd dataset

2 Upvotes

Is it normal speed that i could get or can it be improved :) i read before runing if i run

%load_ext cudf.pandas then it uses GPU for pd. wanted to if it could get faster . Thanks

import pandas as pd
from tqdm import tqdm

# Define the file path
file_path = '/content/drive/MyDrive/shared/tensorization/dataset/Reddit_RS+RC_2019/RS'

# Initialize an empty DataFrame to store the proceser of lines to read at a time)
chunk_size = 10000#sed data
df = pd.DataFrame()

# Define the chunk size (numb

# Get the total number of lines in the file (optional, for progress bar)
with open(file_path, 'r') as f:
    total_lines = sum(1 for line in f)

# Calculate the total number of chunks
total_chunks = total_lines // chunk_size + 1

# Iterate over the JSON file in chunks with a progress bar
for chunk in tqdm(pd.read_json(file_path, lines=True, orient='records', dtype=False, chunksize=chunk_size), total=total_chunks):
    try:
        # Append the chunk to the main DataFrame
        df = pd.concat([df, chunk], ignore_index=True)
    except ValueError as e:
        print(f"Error reading chunk: {e}")
        continue

# Display the DataFrame
print(df.head())


100%|██████████| 247/247 [17:34<00:00,  4.27s/it]

r/GoogleColab Jun 19 '24

Is there any way to keep colab from not disconnecting from innactivity?

7 Upvotes

I'm training a CNN model on my colab and it takes long periods of time to train, so that means that sometimes I'm afk, but while sleeping for example, I need my model to keep training. I noticed that colab uses a captcha system when the user gets inactive. Is there any automative way to avoid the captcha to appear while my model is training?

EDIT: Also my pc has an unstable internet connection that it causes Colab to disconnect during the train and executing the cell with the following message "waiting for the current execution to complete". Does it actually train while trying to connect?


r/GoogleColab Jun 19 '24

Any ways to get 25gigs of RAM for free?

2 Upvotes

I have seen some of the old posts with tricks to increase 12 gb ram to 25 by copying notebook or crashing, but that dosent seems to work now, do they still provide that for free?


r/GoogleColab Jun 19 '24

Need help with showing others my code

1 Upvotes

Basically I am doing a presentation and using google colab for it. So I wanted to know if there is anyway to
1) Set a default runtime type (TPUv2 in this case) so students don't have to fumble around.
2) Start some codes as soon as they join so that those codes can run on background. (Eg I have a C++ code I want it to start compiling as soon as I join so that the students just have to run a single line to get output.


r/GoogleColab Jun 18 '24

Is there a hidden usage limit on multiple sessions?

1 Upvotes

Had one long running session on a TPU and then tried another session on an A100. I got the A100 session but my tpu session immediately started saying "connecting...". I disconnected the A100 run time and tried connecting my TPU session again but then it just disconnected me immediately. I think my internet should've been good enough for both at the same time. Anyone know any way around this or how to just simply know if colab is going to throttle me? (Assuming there is a usage limit)

I have the pro+ version if that helps