Notifications
Clear all

I am using the Sentic-GCN Aspect Based Sentiment Analysis. Is it required to get our dataset to train the model

8 Posts
3 Users
0 Likes
531 Views
(@yixing)
Active Member Member
Joined: 11 months ago
Posts: 2
Topic starter  

Is it necessary to train the model which is already pretrained?


   
Quote
Raymond Ng
(@raymond_aisg)
Eminent Member AISG Staff
Joined: 1 year ago
Posts: 35
 

Hi,

The pretrained weights provided for download by AI Singapore are trained on the Sem-Eval14, Sem-Eval15, and Sem-Eval16 restaurant review dataset (documented in the model card, https://sgnlp.aisingapore.net/aspect-based-sentiment-analysis).

This pretrained model is unlikely to perform well in the domain outside of restaurant review, therefore if your use case is not performing aspect-based sentiment analysis of restaurant review, it is recommended to train your own version of the SenticGCN model with a dataset suitable for your use case.

Hope this helps.

All things NLP


   
ReplyQuote
(@devinlim)
New Member Member
Joined: 11 months ago
Posts: 3
 

@raymond_aisg 
Hello! Can I also check with regards to running the python script for the training of the model, upon modifying the configuration files and downloading all the files required for running the "Training" script as mentioned here: removed link within the

cfg = parse_args_and_load_config()


I received an assertation error:  Torch not compiled with CUDA error, and this is with installing the required CUDA and pytorch versions, can i check if this is an issue with Python 3.10 and that this is the way we are supposed to train the model?

image

   
ReplyQuote
Raymond Ng
(@raymond_aisg)
Eminent Member AISG Staff
Joined: 1 year ago
Posts: 35
 

Hi @devinlim,

This error message is due to the installed Pytorch package not matching the CUDA version installed on your machine. May I check what is CUDA version installed on your machine? And may I also know if you install Pytorch via Pip or Conda?

For example, if you are installing Pytorch using pip and your CUDA version is 11.6, you will need to include the `--extra-index-url https://download.pytorch.org/whl/cu116` argument to your pip install command in order to install the correct compiled version of Pytorch.

https://pytorch.org/

image

All things NLP


   
ReplyQuote
(@devinlim)
New Member Member
Joined: 11 months ago
Posts: 3
 

@raymond_aisg 
I am currently using pytorch 1.13.1 and CUDA 11.6 and I am using pip to install pytorch.

 Upon running the command from Pytorch, it mentions that all requirements are already satisfied, however I still get the same error as above

image
image

   
ReplyQuote
Raymond Ng
(@raymond_aisg)
Eminent Member AISG Staff
Joined: 1 year ago
Posts: 35
 

@devinlim 

To display the CUDA version installed by the GPU, kindly use the `nvidia-smi` command and refer to the version number on the top right. For a summary of the differences between the NVCC compiled CUDA version and the CUDA version installed by the GPU, kindly refer to this forum's answer for a summary.

https://stackoverflow.com/questions/53422407/different-cuda-versions-shown-by-nvcc-and-nvidia-smi

image

Once the installed CUDA version is correct, could you kindly run the following python command to check if your python environment is able is to detect your CUDA device? The following script will print True if the python environment is able to detect the CUDA device.

```

import torch

print(torch.cuda.is_available())

image

If the above script return False, kindly uninstall your install pytorch version first, then reinstall using the pytorch wheel with the CUDA version matching the CUDA version installed on your machine.

The following command uninstall torch and re-install torch for CUDA version 11.6.

 

pip uninstall torch

image

 

Re-run the python script above to confirm that your python environment is able to detect your CUDA device.

Hope this helps.

This post was modified 11 months ago 2 times by Raymond Ng

All things NLP


   
ReplyQuote
(@devinlim)
New Member Member
Joined: 11 months ago
Posts: 3
 

@raymond_aisg Hello, even following all the instructions, the python environment is still unable to locate the CUDA device, I believe pytorch is unsupported for python 3.10, are there any workarounds for this or will we have to create a virtual environment for python 3.9.7?

image

 

image

   
ReplyQuote
Raymond Ng
(@raymond_aisg)
Eminent Member AISG Staff
Joined: 1 year ago
Posts: 35
 

@devinlim 

It would be great to create another virtual environment with python 3.8 or 3.9 to check if the pytorch installer would pick up the proper CUDA version.

You can also try creating an issue at the pytorch github issue board for advice on installing pytorch with CUDA support on Python 3.10 environment.

https://github.com/pytorch/pytorch/issues

All things NLP


   
ReplyQuote
Share: