当前位置:网站首页>transforms. The input of randomcrop() can only be PIL image, not tensor
transforms. The input of randomcrop() can only be PIL image, not tensor
2022-06-26 17:51:00 【LIZHEMGHONG】
This is the original code
Report errors :TypeError: ‘builtin_function_or_method’ object is not iterable
This is the changed code
Report errors :TypeError: img should be PIL Image. Got <class ‘torch.Tensor’>
So I type in tensor It is not right , You should enter PIL image
However, I read a lot of information on the Internet that this function is correct tensor and PIL Fine , I don 't know which one is right , I think I can only input PIL image It can't be tensor
I replace the input with data_i_pil = transforms.ToPILImage()(data_i) After that, the program can run normally
Many people on the Internet say that this function is right tensor and PIL Fine , It's not , Let me give you an example , The following link is one of them
link :https://www.jianshu.com/p/ae695df39274
边栏推荐
- 贝叶斯网络详解
- next(iter(dataloader))的一点点体会
- Ndroid development from introduction to mastery Chapter 2: view and ViewGroup
- sparksql如何通过日期返回具体周几-dayofweek函数
- 数据加密标准(DES)概念及工作原理
- 你好,现在网上股票开户买股票安全吗?
- Concurrent thread safety
- 牛客网:设计LRU缓存结构 设计LFU缓存结构
- Halcon's region: features of multiple regions (5)
- 【代码随想录-动态规划】T583、两个字符串的删除操作
猜你喜欢
vue--vuerouter缓存路由组件
LM06丨仅用成交量构造抄底摸顶策略的奥秘
接水面试题
sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)
Leetcode HOT100 (22--- bracket generation)
LeetCode——226. 翻轉二叉樹(BFS)
pycharm的plt.show()如何保持不关闭
[recommendation system learning] recommendation system architecture
Halcon's region: features of multiple regions (5)
Inspirational. In one year, from Xiaobai to entering the core Department of Alibaba, his counter attack
随机推荐
无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!
关于FlowUs这一款国民好笔记
如何将应用加入到deviceidle 白名单?
用redis做用户访问数据统计HyperLogLog及Bitmap高级数据类型
ZCMU--1367: Data Structure
Rich professional product lines, and Jiangling Ford Lingrui · Jijing version is listed
Leetcode topic [array] -268- missing numbers
Comp281 explanation
LeetCode——226. 翻轉二叉樹(BFS)
mysql Add column 失败 因为之前有数据,不是默认null 不行
牛客网:设计LRU缓存结构 设计LFU缓存结构
宝藏又小众的CTA动画素材素材网站分享
Microservice architecture practice: user login and account switching design, order query design of the mall
Cloud native 02: Alibaba cloud cloud efficient flow pipeline
【Unity】在Unity中使用C#执行外部文件,如.exe或者.bat
Inspirational. In one year, from Xiaobai to entering the core Department of Alibaba, his counter attack
【动态规划】剑指 Offer II 091. 粉刷房子
Notes on flowus
Several key points in divorce agreement
JNI的 静态注册与动态注册