thanks a lot @ptrblck you are right due to some specific package installation for OpenGL I had to update Ubuntu.
So, given Pytorch Encoding is released by same team as PyTorch, I was wondering if you know how  I could change the batch_size?
(torchenc) mona@goku:~$ python test_torch_encoding.py 
Traceback (most recent call last):
  File "test_torch_encoding.py", line 15, in <module>
    output = model.evaluate(img)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/base.py", line 101, in evaluate
    pred = self.forward(x)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/deeplab.py", line 47, in forward
    c1, c2, c3, c4 = self.base_forward(x)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/base.py", line 96, in base_forward
    c3 = self.pretrained.layer3(c2)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
    input = module(input)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/backbone/resnet.py", line 106, in forward
    out = self.bn3(out)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/batchnorm.py", line 131, in forward
    return F.batch_norm(
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/functional.py", line 2056, in batch_norm
    return torch.batch_norm(
RuntimeError: CUDA out of memory. Tried to allocate 12.00 MiB (GPU 0; 3.82 GiB total capacity; 1.91 GiB already allocated; 13.69 MiB free; 2.00 GiB reserved in total by PyTorch)

Even if I pass batch_size of 1,  I still get an error:
(torchenc) mona@goku:~$ python test_torch_encoding.py  --batch_size 1
Traceback (most recent call last):
  File "test_torch_encoding.py", line 15, in <module>
    output = model.evaluate(img)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/base.py", line 101, in evaluate
    pred = self.forward(x)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/deeplab.py", line 47, in forward
    c1, c2, c3, c4 = self.base_forward(x)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/sseg/base.py", line 96, in base_forward
    c3 = self.pretrained.layer3(c2)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
    input = module(input)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch_encoding-1.2.2b20210130-py3.8-linux-x86_64.egg/encoding/models/backbone/resnet.py", line 106, in forward
    out = self.bn3(out)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/modules/batchnorm.py", line 131, in forward
    return F.batch_norm(
  File "/home/mona/venv/torchenc/lib/python3.8/site-packages/torch/nn/functional.py", line 2056, in batch_norm
    return torch.batch_norm(
RuntimeError: CUDA out of memory. Tried to allocate 12.00 MiB (GPU 0; 3.82 GiB total capacity; 1.95 GiB already allocated; 17.31 MiB free; 2.05 GiB reserved in total by PyTorch)

Here are a bit information about my system. Thanks a lot for having a look:
$ nvidia-smi
Thu Feb  4 15:27:57 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 165...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P5     7W /  N/A |    936MiB /  3911MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1182      G   /usr/lib/xorg/Xorg                133MiB |
|    0   N/A  N/A      1786      G   /usr/lib/xorg/Xorg                520MiB |
|    0   N/A  N/A      1962      G   /usr/bin/gnome-shell               88MiB |
|    0   N/A  N/A      2330      G   ...gAAAAAAAAA --shared-files      173MiB |
|    0   N/A  N/A      2593      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      5682      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      5919      G   /usr/lib/firefox/firefox            1MiB |
+-----------------------------------------------------------------------------+

and
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0

and
(torchenc) mona@goku:~$ python
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.7.1'

and
$ lsb_release -a
LSB Version:	core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

Please let me know if further information might be necessary.
  
      github.com/zhanghang1989/PyTorch-Encoding
  
  
    
  
	  
  

  
    
      RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 3.82 GiB total capacity; 2.20 GiB already allocated; 27.88 MiB free; 2.32 GiB reserved in total by PyTorch) 3
    

    
      
        opened 
        
          
        
        Feb 1, 2021
      
      


      
        
          
          monacv
        
      
    
  



  How can I pass the batch_size to an script that is making use of encoding python package?
(torchenc) mona@goku:~$ python test_torch_encoding.py --batch_size...