Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
956 views
in Technique[技术] by (71.8m points)

numpy - Merge multiple .npy files into single .npy file

I have a folder in which I have 100+ .npy files. The path to this folder is '/content/drive/MyDrive/lung_cancer/subset0/trainImages'.

This folder has the .npy files as shown in the image the .npy files

The shape of each of these .npy files is (3,512,512)

I want to combine all of these files into one single file with the name trainImages.npy so that I can train my unet model with it.

My unet model takes input of the shape (1,512,512). I will load the above trainImages.npy file into imgs_train as below to pass it as input into unet model

imgs_train = np.load(working_path+"trainImages.npy").astype(np.float32)

Can someone please tell me how do i concatenate all those .npy files into one single .npy file?? Thanks.

question from:https://stackoverflow.com/questions/65951501/merge-multiple-npy-files-into-single-npy-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...