Platform: Paperspace (Free; Paid options)

Thanks, I’ll try the beta version (new interface)…I was running the intro lesson 1 notebook using the classic version and got the cud out of memory error at the step where it was learning the text vocabulary to determine if a phrase is positive or negative. It was running fine for awhile before it errored out.

1 Like

Hey @Grace1 We are discussing this out of memory issue with the Fast.ai team. It looks like the default batch size is too large for certain GPUs. If you’re not familiar, batch size is the amount of data loaded into GPU memory during the training loop. If you lower this value, you shouldn’t run into the out of memory error. Keep in mind that if you lower it too much, the training time will increase so you should look for a happy medium. We are discussing publishing recommended values for various GPU sizes :slight_smile:

2 Likes

Got this set up and it just works.

Here’s a simpleton question…
Running a Terminal inside Jupyter inside Paperspace inside Firefox inside Ubuntu. I want to paste a line into Terminal. The Edit menu and right mouse click does it. But how can I paste using the keyboard? Locally in Terminal, ctrl-shift-v works, but does not work through all the layers.

Thank you!

Also, the free Paperspace P5000 instance seems to run about twice as fast as my local GTX 1070. Place sad and surprised face here!

2 Likes

Pasting into that terminal is very browser dependent. Try right-click. It used to be that pasting with keyboard only worked on Microsoft Edge, last time I looked.

2 Likes

@Pomo The default terminal in Jupyter is not the best. If you type bash and hit enter, you will be in a bash shell which is probably a bit more familiar. Either one is fine, totally up to you. I believe copy/paste might behave differently in these two terminals.

3 Likes

When I try to run this cell:

img = PILImage.create('images/chapter1_cat_example.jpg')
img.to_thumb(192)

I am getting this error:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-4-f74d6ebc21d1> in <module>
----> 1 img = PILImage.create('images/chapter1_cat_example.jpg')
      2 img.to_thumb(192)

/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai2/vision/core.py in create(cls, fn, **kwargs)
     96         if isinstance(fn,ndarray): return cls(Image.fromarray(fn))
     97         if isinstance(fn,bytes): fn = io.BytesIO(fn)
---> 98         return cls(load_image(fn, **merge(cls._open_args, kwargs)))
     99 
    100     def show(self, ctx=None, **kwargs):

/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai2/vision/core.py in load_image(fn, mode, **kwargs)
     72 def load_image(fn, mode=None, **kwargs):
     73     "Open and load a `PIL.Image` and convert to `mode`"
---> 74     im = Image.open(fn, **kwargs)
     75     im.load()
     76     im = im._new(im.im)

/opt/conda/envs/fastai/lib/python3.6/site-packages/PIL/Image.py in open(fp, mode)
   2807 
   2808     if filename:
-> 2809         fp = builtins.open(filename, "rb")
   2810         exclusive_fp = True
   2811 

FileNotFoundError: [Errno 2] No such file or directory: 'images/chapter1_cat_example.jpg'
  1. The previous cells are OK
  2. It seems that the notebook is not able to find the example image.
  3. How can I solve this?

thanks… I tried changing bs=4 but that seems too small. I also tried 32 but that still gave me the error.

1 Like

@edmar Did you create the notebook recently? We updated the container a few days ago to reflect some changes that happened in the upstream repo:

If you create a new notebook, you should no longer see that error. If you have data in your existing notebook, you can save it to /storage (your persistent directory) or download it to your laptop and upload it to your new notebook. Hope that helps!

@Grace1 Did you try other values eg 8, 16, or 24 by any chance?

I tried 8 and 16 …Let me try 24

1 Like

To clarify, what are you seeing when you try running with bs=8 or 16?

I don’t have the output anymore b/c I’m running it with bs=24, but it was an error stack with CUD: out of memory at the bottom. I’ll paste it if it happens again

1 Like

this is the error I’m getting:
RuntimeError Traceback (most recent call last)
in
3 dls = TextDataLoaders.from_folder(untar_data(URLs.IMDB), valid=‘test’)
4 learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy)
----> 5 learn.fine_tune(4, 1e-2)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/callback/schedule.py in fine_tune(self, epochs, base_lr, freeze_epochs, lr_mult, pct_start, div, **kwargs)
158 base_lr /= 2
159 self.unfreeze()
–> 160 self.fit_one_cycle(epochs, slice(base_lr/lr_mult, base_lr), pct_start=pct_start, div=div, **kwargs)
161
162 # Cell

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/callback/schedule.py in fit_one_cycle(self, n_epoch, lr_max, div, div_final, pct_start, wd, moms, cbs, reset_opt)
110 scheds = {‘lr’: combined_cos(pct_start, lr_max/div, lr_max, lr_max/div_final),
111 ‘mom’: combined_cos(pct_start, *(self.moms if moms is None else moms))}
–> 112 self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd)
113
114 # Cell

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
189 try:
190 self.epoch=epoch; self(‘begin_epoch’)
–> 191 self._do_epoch_train()
192 self._do_epoch_validate()
193 except CancelEpochException: self(‘after_cancel_epoch’)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in _do_epoch_train(self)
162 try:
163 self.dl = self.dls.train; self(‘begin_train’)
–> 164 self.all_batches()
165 except CancelTrainException: self(‘after_cancel_train’)
166 finally: self(‘after_train’)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in all_batches(self)
140 def all_batches(self):
141 self.n_iter = len(self.dl)
–> 142 for o in enumerate(self.dl): self.one_batch(*o)
143
144 def one_batch(self, i, b):

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/learner.py in one_batch(self, i, b)
146 try:
147 self._split(b); self(‘begin_batch’)
–> 148 self.pred = self.model(*self.xb); self(‘after_pred’)
149 if len(self.yb) == 0: return
150 self.loss = self.loss_func(self.pred, *self.yb); self(‘after_loss’)

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/container.py in forward(self, input)
98 def forward(self, input):
99 for module in self:
–> 100 input = module(input)
101 return input
102

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/models/core.py in forward(self, input)
79 #Note: this expects that sequence really begins on a round multiple of bptt
80 real_bs = (input[:,i] != self.pad_idx).long().sum()
—> 81 o = self.module(input[:real_bs,i: min(i+self.bptt, sl)])
82 if self.max_len is None or sl-i <= self.max_len:
83 outs.append(o)

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/models/awdlstm.py in forward(self, inp, from_embeds)
100 new_hidden = []
101 for l, (rnn,hid_dp) in enumerate(zip(self.rnns, self.hidden_dps)):
–> 102 output, new_h = rnn(output, self.hidden[l])
103 new_hidden.append(new_h)
104 if l != self.n_layers - 1: output = hid_dp(output)

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
–> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/models/awdlstm.py in forward(self, *args)
49 #To avoid the warning that comes because the weights aren’t flattened.
50 warnings.simplefilter(“ignore”)
—> 51 return self.module.forward(*args)
52
53 def reset(self):

/opt/conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
557 if batch_sizes is None:
558 result = _VF.lstm(input, hx, self._flat_weights, self.bias, self.num_layers,
–> 559 self.dropout, self.training, self.bidirectional, self.batch_first)
560 else:
561 result = _VF.lstm(input, batch_sizes, hx, self._flat_weights, self.bias,

RuntimeError: CUDA out of memory. Tried to allocate 66.00 MiB (GPU 0; 7.94 GiB total capacity; 7.30 GiB already allocated; 10.38 MiB free; 7.53 GiB reserved in total by PyTorch)

That image was missing from the github repository at the begging, you can pull from the master or recopy again.

Dear @Grace1 Where you able to select a GPU and Paperspace notebook before?

Is there a promotional credit for Paperspace?

They used to have referrals which gave a new user $10 dollar or so when using the referral link. There are a lot of these here in this thread

Just uploaded an image to test something using widgets.fileUpload but can’t find where it put it. When you upload something, where does it go?

2 Likes

Hi All,

I am getting the following error. I used the latest container mentioned above.

IN:
from fastai2.text.all import *

dls = TextDataLoaders.from_folder(untar_data(URLs.IMDB), valid=‘test’)
learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy)
learn.fine_tune(4, 1e-2)

OUT:

FileNotFoundError Traceback (most recent call last)
in
1 from fastai2.text.all import *
2
----> 3 dls = TextDataLoaders.from_folder(untar_data(URLs.IMDB), valid=‘test’)
4 learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy)
5 learn.fine_tune(4, 1e-2)

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/data.py in from_folder(cls, path, train, valid, valid_pct, seed, vocab, text_vocab, is_lm, tok_tfm, seq_len, **kwargs)
207 “Create from imagenet style dataset in path with train,valid,test subfolders (or provide valid_pct).”
208 splitter = GrandparentSplitter(train_name=train, valid_name=valid) if valid_pct is None else RandomSplitter(valid_pct, seed=seed)
–> 209 blocks = [TextBlock.from_folder(path, text_vocab, is_lm, seq_len) if tok_tfm is None else TextBlock(tok_tfm, text_vocab, is_lm, seq_len)]
210 if not is_lm: blocks.append(CategoryBlock(vocab=vocab))
211 get_items = partial(get_text_files, folders=[train,valid]) if valid_pct is None else get_text_files

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/data.py in from_folder(cls, path, vocab, is_lm, seq_len, min_freq, max_vocab, **kwargs)
196 @delegates(Tokenizer.from_folder, keep=True)
197 def from_folder(cls, path, vocab=None, is_lm=False, seq_len=72, min_freq=3, max_vocab=60000, **kwargs):
–> 198 return cls(Tokenizer.from_folder(path, **kwargs), vocab=vocab, is_lm=is_lm, seq_len=seq_len,
199 min_freq=min_freq, max_vocab=max_vocab)
200

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/text/core.py in from_folder(cls, path, tok_func, rules, **kwargs)
270 output_dir = Path(ifnone(kwargs.get(‘output_dir’), path.parent/f’{path.name}_tok’))
271 if not output_dir.exists(): tokenize_folder(path, rules=rules, **kwargs)
–> 272 res = cls(get_tokenizer(tok_func, **kwargs), counter=(output_dir/fn_counter_pkl).load(),
273 lengths=(output_dir/fn_lengths_pkl).load(), rules=rules, mode=‘folder’)
274 res.path,res.output_dir = path,output_dir

/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/utils.py in load(fn)
442 def load(fn:Path):
443 “Load a pickle file from a file name or opened file”
–> 444 if not isinstance(fn, io.IOBase): fn = open(fn,‘rb’)
445 try: return pickle.load(fn)
446 finally: fn.close()

FileNotFoundError: [Errno 2] No such file or directory: ‘/storage/data/imdb_tok/counter.pkl’

Hello,

I’m using the free paperspace gradient instance. Working well (few minor glitches with missing files, but it’s amazing to have the whole thing working in less than a minute!).

I have a question about switching notebooks:
I opened a notebook with, say, lesson 01 of the course. I used it and want to move to lesson 02. I tried to “stop and halt” the notebook but I was still “stuck” in the notebook and couldn’t go back to the directory tree screen where I can choose a different notebook from the course materials folder. I finally managed to do it by going back to the console and pressing start notebook again. Is there an easier way to switch notebooks?

Thanks for the great platform and support!

Yonatan.

1 Like