Category : computer-vision

from keras.models import load_model print("[INFO] Saving model…") pickle.dump(model,open(‘cnn_model.pkl’, ‘wb’)) [INFO] Saving model… ————————————————————————— TypeError Traceback (most recent call last) <ipython-input-95-0812efc6ef19> in <module> 2 3 print("[INFO] Saving model…") —-> 4 pickle.dump(model,open(‘cnn_model.pkl’, ‘wb’)) TypeError: cannot pickle ‘weakref’ object Source: Python..

Read more

When I am replacing ImageLinearAttention with SelfAttention in Vision Transformer, with the code as follows, I get a RuntimeError. The code for ImageLinearAttention is from https://github.com/lucidrains/linear-attention-transformer/blob/master/linear_attention_transformer/images.py except I removed number of channels as you see in commented code. class ImageLinearAttention(nn.Module): def __init__(self, chan, chan_out = None, kernel_size = 1, padding = 0, stride = 1, ..

Read more

Hellllo guys, right now I have this image that has some concentration of white pixels forming a rectangle right in the middle of this image. Surrounding the rectangle-like object, there is a black region. And after the black region, there are some white pixels that are considered to be noise and will be removed from ..

Read more

I am trying to run a train.py file. The command line outputs following error The expanded size of the tensor (320) must match the existing size (400) at non-singleton dimension 1. When I check the (img.shape) tensor the command line shows torch.Size([3, 300, 300]) torch.Size([3, 500, 375]) torch.Size([3, 400, 300]) torch.Size([3, 525, 525]) torch.Size([3, 600, ..

Read more

I’m running code in a computer vision deep learning project, and I can run demo successfully. Now I want to use demo to create a new big dataset. The command to run one picture is: cd /root/.virtualenvs/hmr2.0/hmr2.0-master/src/visualise/ python3 demo.py –image=im00001.jpg –model=base_model –setting=paired-joints –joint_type=cocoplus –init_toes=false And there is a dataset in cd /root/.virtualenvs/hmr2.0/hmr2.0-master/src/visualise/images, including 10000 pictures. ..

Read more

I have a batch size of 1 and number of transformer layers is 1. I have images that are very big so I have created embeddings using ResNet18 as an intermediate representation for tiles of my images. Because my images don’t include different number of tiles, I also have used some sort of masking/zero filling ..

Read more

When I run a train.py file that is suppose to produce semantic segmentation on different images from datasets, I get the following error (QGN) [[email protected] QGN]$ python train.py Input arguments: id ade20k arch_encoder resnet50 arch_decoder QGN_dense_resnet34 weights_encoder weights_decoder fc_dim 2048 list_train ./data/train_ade20k.odgt list_val ./data/validation_ade20k.odgt root_dataset ./data/ num_gpus 1 batch_size_per_gpu 2 num_epoch 20 start_epoch 1 epoch_iters ..

Read more