Posts

Showing posts from April 1, 2019

「1891年1月27日」を作成中

This page is only for reference, If you need detailed information, please check here

pytorch dataloader stucked if using opencv resize method

Image
1 I can run all the cells of the tutorial notebook of Pytorch about dataloading (pytorch tutorial). But when I use OpenCV in place of Skimage to resize the image, the dataloader gets stuck, i.e nothing happens. In the Rescale class: class Rescale(object): ..... def __call__(self, sample): .... #img = transform.resize(image, (new_h, new_w)) img = cv2.resize(image, (new_h, new_w)) ..... The dataloader and the for loop are defined with: dataloader = DataLoader(transformed_dataset, batch_size=4, shuffle=True, num_workers=4) for i_batch, sample_batched in enumerate(dataloader): print(i_batch, sample_batched['image'].size(), sample_batched['landmarks'].size()) I can get the iterator to print something i...

write output of for loop in csv python

Image
0 1 i want to write the result of for loop which is PMID = Id of litrature ,Date = date of publication ,title = title of article,Abstract = abtract of artilce in csv file but it is saving only one element of the output no all import numpy as np from Bio import Entrez from Bio import Medline import csv import pandas as pd Entrez.email = "shayezkarimcide@gmail.com" handle = Entrez.esearch(db="pmc", term = "Antimicrobial resistance Drug Resistance", rettype = "medline",retmode = "txt", retmax= "200",sort = "pub date") result = Entrez.read(handle) handle.close() Id = result ['IdList'] print (Id) handle2 = Entrez.efetch(db="pmc", id=Id, rettype="medlin...