最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Weird Behavior of np.loadtxt() - Stack Overflow

programmeradmin7浏览0评论

I'm currently reading a neural network project using debug tool in VScode. There is a function

def load_img_name_list(dataset_path):

    img_name_list = np.loadtxt(dataset_path, dtype=np.int32)
    return img_name_list

I constantly stuck and got ValueError could not convert string '2007_000032' to int32 at row 0, column 1.. Since my txt file has data like "2007_000032", I'm not surprised.

BUT when I run (NOT debug) it was totally fine?! If I print the first 5 item in the list, it shows image_name_list: [2007000032 2007000039 2007000063 2007000068 2007000121].

They both run in the same environment, I'm so confused about what is going on, can anyone help please? Any help is appreciated!!!

发布评论

评论列表(0)

  1. 暂无评论