我想把一整个文件夹的图片加载到一起。我在R中使用Keras与python接口工作。我设置了文件夹的路径,然后用lapply函数逐一加载文件夹中的图片。
> files <- list.files(path="C:/Users/acer/Desktop/Triparna/traitestimage/Test/Bone/", pattern=".png",all.files=T, full.names=F, no.. = T)
> list_of_images = lapply(files, image_load)
The error :
Error in py_call_impl(callable, dots$args, dots$keywords) :
FileNotFoundError: [Errno 2] No such file or directory: 'bone58.png'
Detailed traceback:
File "C:\Users\acer\ANACON~1\envs\R-TENS~1\lib\site-
packages\keras\preprocessing\image.py", line 387, in load_img
img = pil_image.open(path)
File "C:\Users\acer\ANACON~1\envs\R-TENS~1\lib\site-
packages\PIL\Image.py", line 2548, in open
fp = builtins.open(filename, "rb")
能否请你帮助我。我知道Python接口无法识别路径。但我如何做到这一点呢?