Getting truth value of array with more than one element in ambigous for albuementation transform

I am using albumentations for applying transform to a Pytorch model but getting this error and I m not getting any clue of what this error is about. Only thing I know is this is occuring due to...

Contextual version conflict error, Google colab

I am trying to install and run sunpy on Google colab. It requires a package astropy version 3.1 or higher. Even after installing astropy version 3.2.1 when I import sunpy it gives the following...

AttributeError: 'MpoImageFile' object has no attribute 'shape'

images, labels = next(iter(self.loader)) grid = torchvision.utils.make_grid(images) images, labels = next(iter(self.loader)) triggers the error. I have a custom dataset class where I load each...

How to better identify what causes segmentation fault in python?

I am having trouble with segmentation fault in Python. Sometimes it happens, sometimes it doesn't but when it does I used gdb python as explained in this answer and I get this result: [... a lot...

Jupyter: The kernel appears to have died. It will restart automatically. (Keras Related)

I'm trying to train a Resnet50 but failing no matter what I do since the Jupyter notebook's Kernel is dying (The kernel appears to have died. It will restart automatically), the moment it starts...

How to fix the errors when installing beam on Google Colab

I started learning beam, and found google colab is a good place to start it (per a course I am following), however, the first thing is to install beam in Colab and it throws some error when I...

Albumentations RandomCrop with mask different size as image

is it possible to RandomCrop an image with the size 256x256 and the mask with the size 100x100? Or RandomGridShuffle and...

ImportError: cannot import name 'downsample' while importing lasagne in python 3.6

I am getting the above error with the following import statements on Google Colab GPU: import argparse #import cPickle import _pickle as cPickle import time import os import numpy as np import...

Permanent Library Colab - Dependencies

I am trying to install a permanent library in Google Colaboratory. I am following the instructions listed at...

Process got killed when building docker image on GCP

I am a newbie of cloud computing and struggling to deploy my web app on google cloud platform for the first time. When I was building docker image, which means I ran the following code docker...

Custom ImageDataGenerator keras

I've been trying to implement Keras custom imagedatagenerator so that I can do hair and microscope image augmentation. This is the Datagenerator class: class DataGenerator( Sequence ): def...

ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory when importing cv2 using Docker container

I was builting a web app with streamlit, OpenCV and Torch on local machine. The whole project went well until I built a Docker file and was about to transport it to my Google Cloud Platform. Can...

Using albumentation with Tensorflow Sequence API

I am trying to use tf.keras.utils.Sequence object as input to my keras model so,that I can apply augmentations that are not available in tensorflow using albumentations library. But I am getting...

Installing tensorflow on Google Colaboratory shows a dependency problem

Collecting tensorflow Downloading https://files.pythonhosted.org/packages/97/ae/0b08f53498417914f2274cc3b5576d2b83179b0cbb209457d0fde0152174/tensorflow-2.3.0-cp36-cp36m-manylinux2010_x86_64.whl...

Augmenting tf.data.Dataset elements from any external library( albumentations in my case)

I am creating a mapping function which augments each image in the dataset, which is then wrapped by the tf.numpy_function to create a tensorflow op. Now this tensorflow op is passed to the...

pytorch DataLoader extremely slow first epoch

When I create a PyTorch DataLoader and start iterating -- I get an extremely slow first epoch (x10--x30 slower then all next epochs). Moreover, this problem occurs only with the train dataset from...

Batch processing with Nvidia's TensorRT

I converted the trained model to onnx format, and then created the TensorRT engine file from onnx model. I used the below snnipet code for doing this? import pycuda.driver as cuda import...

Runtimeerror: Cuda out of memory - problem in code or gpu?

I am currently working on a computer vision project. I keep getting a runtime error that says "CUDA out of memory". I have tried all possible ways like reducing batch size and image resolution,...

fatal error: cuda_runtime_api.h: No such file or directory when trying to use cuda in docker

I am trying to build a docker image for a python script that I would like to deploy. This is the first time I am using docker so I'm probably doing something wrong but I have no clue what. My...

Using albumentation's augmentation in tensorflow dataset API is giving this error : Incompatible shapes expected [?,224,224,3] but got [8,1,224,224,3]

I am getting this error while trying to augment the images using the albumentations library which uses tf.numpy_function to wrap the python function for augmentation in tensorflow from this link...

"iterating over `tf.Tensor` is not allowed in Graph execution." while using numpy_function to return more than one variable

I'm not sure if this just isn't intended, a bug, or if I'm doing it wrong. I'm trying to use a library called albumentations to augment both images and their corresponding keypoints. However,...

I cannot use opencv2 and received ImportError: libgl.so.1 cannot open shared object file no such file or directory

env:ubuntu16.04 anaconda3 python3.7.8 cuda10.0 gcc5.5 command: conda activate myenv python import cv2 error: Traceback (most recent call last): File "", line 1, in File...

from ._nnls import nnls ImportError: DLL load failed: The specified module could not be found

While running a UNet traning code I found DLL load failed error. Here is the code: ''' import torch import scipy import albumentations as A from ._nnls import nnls from...

ValueError: Expected x_max for bbox (0.65, 0.51, 1.12, 0.64, 3) to be in the range [0.0, 1.0], got 1.1234809015877545

I want to apply data augmentations from PyTorch's Albumentations to images with bounding boxes. When I apply the HorizontalFlip Transformation, I receive this error ValueError: Expected x_max for...

Data augmentation with bounding boxes

I want to train an object detection model using YOLO v4. I have a folder containing jpg images with the bounding boxes annotations in a txt file. I don't have much data so I decided to do some...

Cannot fix ImportError: cannot import name 'ToTensorV2' from 'albumentations.pytorch' on Colab

I tried all three solutions from this question to solve the problem, but still receive an error: ImportError: cannot import name 'ToTensorV2' from 'albumentations.pytorch'...

Agumenting data in keras using albumentations

I am trying to train a keras ResNet50 model for image classification model using a tuorial. Insted of the inbult data generator, I want to use albumentations for augmentation. from albumentations...

Sudden Tensorflow / Keras Google Colab dependency problems `AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute '__internal__'`

I have running a machine learning model (Matterport's Mask R-CNN) in google colab for a couple of weeks. All of a sudden today I am unable to run any of my notebooks due to I think some kind of...

module 'tensorflow.compat.v2.__internal__' has no attribute 'tf2'

I'm trying to use TensorFlow as backend yesterday I can use it, but today when I use it to show some error message when I'm trying to import Keras, so here's my code: # Install required libs #...