Comments (7)
Would you please let me know in which config/job you met the problem?
from contrastivecrop.
I added this code to the TSN network and added it to the training part, but the 'box' parameter was abnormal when calling
from contrastivecrop.
def get_augmentation(self): if self.modality == 'RGB': return torchvision.transforms.Compose([ GroupMultiScaleCrop(self.input_size, [1, .875, .75, .66]), GroupRandomHorizontalFlip(is_flow=False), # 增加数据增强 ContrastiveCrop(size=32, scale=(0.2, 1.0)) ])
from contrastivecrop.
Traceback (most recent call last): File "D:\download\TSN-pytorch\main.py", line 165, in <module> main() File "D:\download\TSN-pytorch\main.py", line 139, in main train(args.record_path,train_loader, model, criterion, optimizer, epoch, args.clip_gradient) File "D:\download\TSN-pytorch\train.py", line 18, in train for i, (data, target) in enumerate(train_loader): File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 521, in __next__ data = self._next_data() File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\download\TSN-pytorch\dataset\dataset.py", line 67, in __getitem__ return self._get(record, segment_indices) File "D:\download\TSN-pytorch\dataset\dataset.py", line 122, in _get process_data = self.transform(images) File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torchvision\transforms\transforms.py", line 60, in __call__ img = t(img) File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torchvision\transforms\transforms.py", line 60, in __call__ img = t(img) File "C:\Users\lenovo\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) TypeError: forward() missing 1 required positional argument: 'box'
这是报的错误,谢谢
from contrastivecrop.
You should pass a tuple/list (h_min, w_min, h_max, w_max)
normalized in [0, 1] which indicates the box, as in this code.
from contrastivecrop.
Sorry to bother you. I had the same problem, but I still didn't fix it. This is my original code.
trans_list = [ContrastiveCrop(alpha=0.6, size=224, scale=(0.2, 1.0))]
data_transform_2 = transforms.Compose(trans_list)
pic = data_transform_2(img_test)
plt.imshow(pic)
plt.show()
I was just trying to visualize the ContrastiveCrop
. I also added box
after img_test
, but I still get an error.
trans_list = [ContrastiveCrop(alpha=0.6, size=224, scale=(0.2, 1.0))]
data_transform_2 = transforms.Compose(trans_list)
pic = data_transform_2(img_test, [0.1, 0.1, 0.9, 0.9])
plt.imshow(pic)
plt.show()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-81-0001e52f5c9e> in <module>
2 data_transform_2 = transforms.Compose(trans_list)
3
----> 4 pic = data_transform_2(img_test, [0.1, 0.1, 0.9, 0.9])
5 plt.imshow(pic)
6 plt.show()
TypeError: __call__() takes 2 positional arguments but 3 were given
from contrastivecrop.
Please try CCompose instead, which takes box
for the first transformation.
from contrastivecrop.
Related Issues (20)
- ask about the downstream application HOT 2
- some question about bbox_update HOT 4
- question HOT 3
- datasets HOT 2
- A little confusion about training HOT 4
- Some questions about the running process of contrastive cropping HOT 2
- The cropping may have some issues HOT 4
- Question about the cropping candidate regions
- A question about pseudocode HOT 5
- More models and datasets coming soon? HOT 2
- An implementation detail to consult HOT 1
- A HOT 1
- A quesition
- Some questions for the papers HOT 4
- 请问ContrastiveCrop的ratio的参数是多少? HOT 1
- How can I use it for downstream tasks HOT 4
- dataloader and updating the box HOT 3
- support custom dataset HOT 2
- how to use this code,thanks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contrastivecrop.