When I do this I just get
(gdb) bt
No stack.

Full outputs below and inputs below, in case I’m doing something silly that’s preventing the backtrace from appearing.
However, to make sure the lack of backtrack wasn’t just pytest/Tornado swallowing the error on a different thread, I pulled all the tests out and run them manually. In doing so I realised I only see the error where when I’ve called a used a model from the python lifelines packaged before I call pytorch. If I don’t run the tests on the lifelines model, all the pytorch tests succeed.
So, maybe this is a lifelines issue and not a pytorch problem? Super strange though that the error occurs when running pytorch.
$ PYTHONPATH=./ gdb --args python research/app/tests/test_model.py 
                                                                                                                                                                           
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(gdb) run
Starting program: /home/ubuntu/miniconda3/envs/reti/bin/python research/app/tests/test_model.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe783d700 (LWP 39184)][New Thread 0x7fffe703c700 (LWP 39185)]
Traceback (most recent call last):
  File "/home/ubuntu/reti/research/app/tests/test_model.py", line 109, in <module>
    test.test_retina_model()
  File "/home/ubuntu/reti/research/app/tests/test_model.py", line 9, in test_retina_model
    result = process_image(env.GEORGE_LEFT)                                                                  in decorate_context
  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntu/reti/research/app/models/models.py", line 73, in process_image
    raise exc
  File "/home/ubuntu/reti/research/app/models/models.py", line 55, in process_image                         , in _call_impl    embed = MODEL(image)
  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)                                                                   , in _call_impl
  File "/home/ubuntu/reti/research/models/biobank.py", line 141, in forward    embed = self.encoder(x)
  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl                                                                                             89, in extract_features    return forward_call(*input, **kwargs)
  File "/home/ubuntu/reti/research/models/efficientnets.py", line 16, in forward                            , in _call_impl
    x = self.extract_features(inputs)  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/efficientnet_pytorch/model.py", line 275, in forward89, in extract_features
    x = self._swish(self._bn0(self._conv_stem(inputs)))
  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/ubuntu/miniconda3/envs/reti/lib/python3.9/site-packages/efficientnet_pytorch/utils.py", line 275, in forward
    x = F.conv2d(x, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups)
RuntimeError: std::bad_alloc                                                                                                                                                                                                                         "ip-172-31-39-215" 17:46 09-Dec-21
[Thread 0x7fffe703c700 (LWP 39185) exited]
[Thread 0x7fffe783d700 (LWP 39184) exited]
[Inferior 1 (process 39155) exited with code 01]
(gdb) bt
No stack.