Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to train model on vl_cmu_cd dataset? #13

Closed
jcluo1994 opened this issue Dec 8, 2022 · 28 comments
Closed

how to train model on vl_cmu_cd dataset? #13

jcluo1994 opened this issue Dec 8, 2022 · 28 comments

Comments

@jcluo1994
Copy link

thanks for sharing your great work.when i use this code train my model like vl_cmu_cd format,but it did't work,the error is the following:
return _VF.broadcast_tensors(tensors) # type: ignore[attr-defined]
RuntimeError: The size of tensor a (512) must match the size of tensor b (3) at non-singleton dimension 4
look forward for your reply

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

This problem is about the input tensor shape of the ground truth. Please confirm your input gt's shape.

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

The gt's shape should be (B 1 H W).

@jcluo1994
Copy link
Author

The gt's shape should be (B 1 H W).

thanks for reply,which format of vl_cmu_cd dataset should be selected ,the gt**.png or maks**.png?

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

Please covert the gt.png in vl_cmu_cd dataset into mask.png which denotes the change map.

@jcluo1994
Copy link
Author

Please covert the gt.png in vl_cmu_cd dataset into mask.png which denotes the change map.
that means consisting of two labels (change and no-change)for change detection,ok i will try again.

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

It seems vlcmucd only has semantic labels instead of CD labels. You need to generate CD labels before training. Please review it's introduction in their paper.

@jcluo1994
Copy link
Author

It seems vlcmucd only has semantic labels instead of CD labels. You need to generate CD labels before training. Please review it's introduction in their paper.

yes, i have convert the dataset to binary,and, the code is running.but, the new error is the following:

Traceback (most recent call last):
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/http/client.py", line 1287, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/http/client.py", line 1333, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/http/client.py", line 1282, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/http/client.py", line 1042, in _send_output
self.send(msg)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/http/client.py", line 980, in send
self.connect()
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fd559f9c710>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /events (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd559f9c710>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/visdom/init.py", line 695, in _send
data=json.dumps(msg),
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/visdom/init.py", line 656, in _handle_post
r = self.session.post(url, data=data)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/requests/sessions.py", line 577, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): Max retries exceeded with url: /events (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd559f9c710>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/home/inspur/anaconda3/envs/pytorch/lib/python3.6/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

Did u open visdom?

@jcluo1994
Copy link
Author

Thank you for your guidance.The code is already running.i use test.txt as val.txt in vl_cmu_cd dataset.but the value of f1 is always 0.

@wangle53
Copy link
Owner

wangle53 commented Dec 8, 2022

Something must be wrong. You may carefully check your input and gt.Please make sure your the final input gt value is between 0 and 1.

@jcluo1994
Copy link
Author

Something must be wrong. You may carefully check your input and gt.Please make sure your the final input gt value is between 0 and 1.

Thank you for your reply. There are 11 classes in the vl_cmu_cd dataset, which means that the label values are the eleven values of [0,1]. Is that right?

@wangle53
Copy link
Owner

wangle53 commented Dec 9, 2022

No, you misunderstand what i mean. As shown in the follow img.
image

  1. convert gt.png into binary CD labels mask.png.
  2. Please make sure the input mask.png within the range of [0, 1].

@jcluo1994
Copy link
Author

No, you misunderstand what i mean. As shown in the follow img. image

  1. convert gt.png into binary CD labels mask.png.
  2. Please make sure the input mask.png within the range of [0, 1].

Yes, Sir. I see what you mean and I am revising it. I'll tell you the good news when I finish the work. Thank you very sincerely.

@wangle53
Copy link
Owner

wangle53 commented Dec 9, 2022

You are welcome. Hope u will contact me again if u have further questions.

@jcluo1994
Copy link
Author

You are welcome. Hope u will contact me again if u have further questions.

Good afternoon, the code is running correctly and I have read your code carefully again. There are some doubts. For example,config.category = ['test'],I don't know what that does. It didn't seem to work in the end.
1
I've highlighted the exact location in the picture.

@wangle53
Copy link
Owner

wangle53 commented Dec 9, 2022

It seems this code are redundant. Please delete it.

@wangle53
Copy link
Owner

wangle53 commented Dec 9, 2022

Thanks for ur reminding, I will update the code later.

@jcluo1994
Copy link
Author

Thanks for ur reminding, I will update the code later.
I've learned a lot from your code, and config.category = ['test'] it works in test.py.I will continue to learn your code.

@wangle53
Copy link
Owner

wangle53 commented Dec 9, 2022

I'm so glad that my work helps you. Good luck.

@jcluo1994
Copy link
Author

I'm so glad that my work helps you. Good luck.

Hello, That's exciting news.I have developed my own model using open source data. It looks pretty good.However, I want to make my own data set, but I don't know how to set the label value of the data set. could you give me some guidance?

@wangle53
Copy link
Owner

The label values of semantic objects are all up to u. In a general way, for CD task, labels are set [0, 1] or [0, 255]. If u want to label ur own dataset like the setting in VL-CMU-CD, only give a specific value for each semantic category. The label tool is introduced to use 'labelme'.

@jcluo1994
Copy link
Author

The label values of semantic objects are all up to u. In a general way, for CD task, labels are set [0, 1] or [0, 255]. If u want to label ur own dataset like the setting in VL-CMU-CD, only give a specific value for each semantic category. The label tool is introduced to use 'labelme'.

I think I know what you mean, just mark the difference, the corresponding name doesn't matter. In the figure below, I have marked the differences, using numbers instead of label names for simplicity. Finally, the pixel value of the image is converted to [0,1].
2

@wangle53
Copy link
Owner

It's ok.

@jcluo1994
Copy link
Author

It's ok.

Ok, thank you for your guidance.

@jcluo1994
Copy link
Author

long time no see, how are you lately? I am planning to do some changedetection projects recently, I would like to ask you, is there a relationship between the accuracy of detection and the depth of the network?

1 similar comment
@jcluo1994
Copy link
Author

long time no see, how are you lately? I am planning to do some changedetection projects recently, I would like to ask you, is there a relationship between the accuracy of detection and the depth of the network?

@wangle53
Copy link
Owner

wangle53 commented May 9, 2023

Within limits,it is.

@jcluo1994
Copy link
Author

ok, i got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants