当前位置:网站首页>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
边栏推荐
- Uncover the secret of Agora lipsync Technology: driving portraits to simulate human speech through real-time voice
- [recommendation system learning] technology stack of recommendation system
- 正则匹配相同字符
- Troubleshooting ideas that can solve 80% of faults!
- halcon之区域:多种区域(Region)特征(5)
- Niuke network: Design LRU cache structure design LFU cache structure
- 二分查找-2
- [uniapp] the uniapp mobile terminal uses uni Troubleshooting of navigateback failure
- 力扣每日一题-第28天-566.重塑矩阵
- Prometeus 2.34.0 new features
猜你喜欢

14《MySQL 教程》INSERT 插入数据

Treasure and niche CTA animation material website sharing

玩轉Linux,輕松安裝配置MySQL

Concurrent thread safety

Here comes the hero League full skin Downloader
![[recommendation system learning] technology stack of recommendation system](/img/ff/afc6f4b0997cfcb9e01ffbebf2a872.png)
[recommendation system learning] technology stack of recommendation system

Halcon's region: features of multiple regions (5)

next(iter(dataloader))的一点点体会

Vue--vuerouter cache routing component

Inspirational. In one year, from Xiaobai to entering the core Department of Alibaba, his counter attack
随机推荐
Here comes the hero League full skin Downloader
直播预告|程序员进击,如何提升研发效能?6月21日晚视频号、B站同步直播,不见不散!
Applet setting button sharing function
数字签名标准(DSS)
I want to know. I am in Zhaoqing. Where can I open an account? Is it safe to open an account online?
How to add an application to the deviceidle whitelist?
数据加密标准DES安全性
清华&商汤&上海AI&CUHK提出Siamese Image Modeling,兼具linear probing和密集预测性能!
力扣每日一题-第28天-566.重塑矩阵
VSCode使用 - Remote-SSH 配置说明
Microservice architecture practice: business management background and SSO design, SSO client design
ZCMU--1367: Data Structure
【推荐系统学习】推荐系统架构
RSA加密解密详解
Detailed explanation of browser storage methods: the origin and difference of cookies, localstorage and sessionstorage
Number of solutions for knapsack problem
js强制转换
【动态规划】剑指 Offer II 091. 粉刷房子
关于FlowUs这一款国民好笔记
Concurrent thread safety