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

Issue with Input Type Error in "A Convolutional Attention Network for Extreme Summarization of Source Code" Implementation #1

Open
lidiancracy opened this issue Sep 3, 2023 · 0 comments

Comments

@lidiancracy
Copy link

Hello,I've been trying to run the code for the "A Convolutional Attention Network for Extreme Summarization of Source Code" paper, and I've encountered an error that seems related to an input type mismatch. Here's the error I'm getting:

(conv) luowangda@hlt-PR4904P:~/LDpacong/convolutional-attention-master/convolutional_attention$ python copy_conv_rec_learner.py /home/luowangda/LDpacong/convolutional-attention-master/datautils/4refr0nt_train_methodnaming.json 5 128 /home/luowangda/LDpacong/convolutional-attention-master/datautils/4refr0nt_train_methodnaming.json
saving best result so far to copy_convolutional_att_rec_model4refr0nt_train_methodnaming.json.pkl
Extracting data...
WARNING (theano.tensor.blas): We did not find a dynamic library in the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.
WARNING (theano.tensor.blas): We did not find a dynamic library in the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.
[Sun Sep  3 12:58:44 2023] Starting training...
0Traceback (most recent call last):
  File "copy_conv_rec_learner.py", line 318, in <module>
    model.train(input_file, max_epochs=max_num_epochs)
  File "copy_conv_rec_learner.py", line 88, in train
    train_target_is_unk[pos], train_name_targets[pos])
  File "/home/luowangda/anaconda3/envs/conv/lib/python3.7/site-packages/theano/compile/function_module.py", line 813, in __call__
    allow_downcast=s.allow_downcast)
  File "/home/luowangda/anaconda3/envs/conv/lib/python3.7/site-packages/theano/tensor/type.py", line 124, in filter
    up_dtype = scal.upcast(self.dtype, data.dtype)
  File "/home/luowangda/anaconda3/envs/conv/lib/python3.7/site-packages/theano/scalar/basic.py", line 78, in upcast
    rval = str(z.dtype)
AttributeError: Bad input argument to theano function with name "/home/luowangda/LDpacong/convolutional-attention-master/convolutional_attention/copy_conv_rec_model.py:284" at index 0 (0-based).  
Backtrace when that variable is created:
  File "copy_conv_rec_learner.py", line 318, in <module>
    model.train(input_file, max_epochs=max_num_epochs)
  File "copy_conv_rec_learner.py", line 40, in train
    self.naming_data.name_empirical_dist)
  File "/home/luowangda/LDpacong/convolutional-attention-master/convolutional_attention/copy_conv_rec_model.py", line 26, in __init__
    self.__init_parameter(empirical_name_dist)
  File "/home/luowangda/LDpacong/convolutional-attention-master/convolutional_attention/copy_conv_rec_model.py", line 119, in __init_parameter
    self.__compile_model_functions()
  File "/home/luowangda/LDpacong/convolutional-attention-master/convolutional_attention/copy_conv_rec_model.py", line 263, in __compile_model_functions
    sentence = T.ivector("sentence")
'int' object has no attribute 'dtype'

From my analysis, it appears to be an issue with the data type of the input passed to the Theano function. I noticed that the original repository has been archived, so I had to come over to this repository to raise the issue. I'd appreciate it if you could take a look and provide some guidance on how to resolve this.

Thank you for your time and assistance!

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

1 participant