yufengm / Adaptive

Pytorch Implementation of Knowing When to Look: Adaptive Attention via A Visual Sentinel for Image Captioning
107 stars 42 forks source link

adaptive.py dimension error #16

Open chillaxkrish opened 3 years ago

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ?

Tensor flow dimension

Capturek

dreamyuchen commented 3 years ago

Could please tell me how to solve this runtime error ?

Tensor flow dimension

Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!!

But I got another issue

image

File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

Can you please help me in this ?

dreamyuchen commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!!

But I got another issue

image

File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!!

Is their any way to reduce the dataset for the train.py ? . Its very slow ..

and then where we can do the test image validation in this project ? can you help me in this please !

image

dreamyuchen commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!!

Is their any way to reduce the dataset for the train.py ? . Its very slow ..

and then where we can do the test image validation in this project ? can you help me in this please !

image

If you want to reduce the number of dataset for train you have to change the settings in KarpathSplit.py. If you want to do test, you should write a test function ,you can learn how to write test functions from other image caption codes which have test function.

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!! Is their any way to reduce the dataset for the train.py ? . Its very slow .. and then where we can do the test image validation in this project ? can you help me in this please ! image

If you want to reduce the number of dataset for train you have to change the settings in KarpathSplit.py. If you want to do test, you should write a test function ,you can learn how to write test functions from other image caption codes which have test function.

Thank you so much for helping me in this project !!!

Can you share code for the test function ? or any related test function for this project image caption. I have searched before but I can't link with in this project... please

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!! Is their any way to reduce the dataset for the train.py ? . Its very slow .. and then where we can do the test image validation in this project ? can you help me in this please ! image

If you want to reduce the number of dataset for train you have to change the settings in KarpathSplit.py. If you want to do test, you should write a test function ,you can learn how to write test functions from other image caption codes which have test function.

Thank you so much for helping me in this project !!!

Can you share code for the test function ? or any related test function for this project image caption. I have searched before but I can't link with in this project... please

Can you please tell me what input have to give in this below image . After computing METEOR score... its keep on loading .. Will you please image

dreamyuchen commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!! Is their any way to reduce the dataset for the train.py ? . Its very slow .. and then where we can do the test image validation in this project ? can you help me in this please ! image

If you want to reduce the number of dataset for train you have to change the settings in KarpathSplit.py. If you want to do test, you should write a test function ,you can learn how to write test functions from other image caption codes which have test function.

Thank you so much for helping me in this project !!! Can you share code for the test function ? or any related test function for this project image caption. I have searched before but I can't link with in this project... please

Can you please tell me what input have to give in this below image . After computing METEOR score... its keep on loading .. Will you please image

sorry,I don't have the same problems running the code as you do.I guess there is some problem with your pycocoevalcap...Perhaps you can download the latest PyCocoTools and the latest PyCocoevalcap to replace the referenced parts of the code

chillaxkrish commented 3 years ago

Could please tell me how to solve this runtime error ? Tensor flow dimension Capturek

I solved this problem, you shuld add h_t = h_t.squeeze(1) before hiddens[:, time_step, :] = h_t

yeah its working thank you !!!! But I got another issue image File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 621, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Can you please help me in this ?

You should change the code loss.data to loss.item() and you'll be able to run the code smoothly

Thanks you so much !!! Is their any way to reduce the dataset for the train.py ? . Its very slow .. and then where we can do the test image validation in this project ? can you help me in this please ! image

If you want to reduce the number of dataset for train you have to change the settings in KarpathSplit.py. If you want to do test, you should write a test function ,you can learn how to write test functions from other image caption codes which have test function.

Thank you so much for helping me in this project !!! Can you share code for the test function ? or any related test function for this project image caption. I have searched before but I can't link with in this project... please

Can you please tell me what input have to give in this below image . After computing METEOR score... its keep on loading .. Will you please image

sorry,I don't have the same problems running the code as you do.I guess there is some problem with your pycocoevalcap...Perhaps you can download the latest PyCocoTools and the latest PyCocoevalcap to replace the referenced parts of the code

Yeah ok ..

Now am facing new error . Can you please help me ?

image