SenticGCNBert confi...
 
Notifications
Clear all

Question SenticGCNBert config file

20 Posts
4 Users
2 Likes
134 Views
joeylim
Posts: 7
Member
(@joeylim)
Active Member
Joined: 2 weeks ago

Hi,

I have tried multiple times using the same path directory for my "save_model_path" and "model_path" but I am still receiving the error of "] No such file or directory: 'C'". I have also tried using the .json file that was created after it has been trained and it does not work too.

Reply
1 Reply
Raymond Ng
AISG Staff
(@raymond_aisg)
Joined: 4 months ago

Eminent Member
Posts: 23

@joeylim Hi,

Could you kindly provide a screenshot or a copy of the error call stack?

Please also note that the `save_model_path` and the `model_path` are relative to the location where the training script is executed.

Reply
joeylim
Posts: 7
Member
(@joeylim)
Active Member
Joined: 2 weeks ago
image
image
image

@raymond_aisg Hi,

I have attached the picture of the path of the files created when the model has been train and the error that was flagged from running the evaluating program.

Reply
1 Reply
Raymond Ng
AISG Staff
(@raymond_aisg)
Joined: 4 months ago

Eminent Member
Posts: 23

@joeylim Hi,

Thank you very much for the screenshot.

From what I can see from the screenshot, the `model_path` in the config file is residing in the `SGnlp test real\\Model` folder whereas the screenshot of the explorer where the model file resides is in the `SGnlp current\\Model`,  could you kindly check if this is correct?

If the folder path is correct, could you kindly use a debugger to view the `cfg` object when running the evaluation script and print out the `model_path` argument during runtime?

Thank you.

Reply
joeylim
Posts: 7
Member
(@joeylim)
Active Member
Joined: 2 weeks ago
image
image
image

@raymond_aisg Hi,

My apologies, I have tried to recreate the config file and I am facing a different error currently. Both the "model_path" and the "save_model_path" are having the same directory file location which contains our config and weights model that has been trained.

Thank you for assisting with us in this problem!!

Reply
1 Reply
Raymond Ng
AISG Staff
(@raymond_aisg)
Joined: 4 months ago

Eminent Member
Posts: 23

@joeylim Hi,

This is a most curious error, unfortunately, I do not have a Window system to try out the path.

However, the error message you printed is very interesting, usually, for such an error the whole path is printed in the error trace instead of just the first character 'C'.

Off the top of my head, there are 2 things to try,

First, I'm wondering if you could replace `model_path` with just the folder name, `senticgcnbert` and execute the evaluation script at the root folder, 'C:\\Users\\user\Desktop\\SGnlp test\\`.

If the above doesn't work, could you try replacing the `\\` with `/` from the `model_path` so that it appears 'C:/Users/user/Desktop/SGnlp test/senticgcnbert'.

This is because the loading part of the code calls `pathlib.Path` and from the Python documentation, it uses the `/` for path,

https://docs.python.org/3/library/pathlib.html#pathlib.PureWindowsPath

The loading part of the code is here,

https://github.com/aisingapore/sgnlp/blob/main/sgnlp/models/sentic_gcn/eval.py#L98

Hope this helps.

Reply
joeylim
Posts: 7
Member
(@joeylim)
Active Member
Joined: 2 weeks ago

@raymond_aisg Hi,

Thanks for the advices!!! But unfortunately I was still unable to evaluate the test model with the two things that were suggested above. I have tried to create a new folder to store my model too and it did not work. Can I check once again if I am doing the right thing by using the location file model where it contains both the json and the bin file for the "model_path".

Thank you!

Reply
joeylim
Posts: 7
Member
(@joeylim)
Active Member
Joined: 2 weeks ago
image
image

@raymond_aisg Hi,

I have tried using the json file of the model which was created after the training and it does not work too! Will it be possible for us to have another sample file folder that has a config file that links the model path too so that me and my team will be able to further understand and learn how to use the config file well?

Thank You for assisting with our problems so far!! and we Hope to hear from you soon!!

Reply
1 Reply
Raymond Ng
AISG Staff
(@raymond_aisg)
Joined: 4 months ago

Eminent Member
Posts: 23

@joeylim Hi,

My apologies for the difficulties with using the SenticGCN model so far. There might be a bug in the code which affected your use case which we are unaware of. I will source for a Windows PC shortly to look into this issue.

Please note that the `model_path` config should be pointing to the folder which contains both the `config.json` file and the `pytorch_model.bin` file and not just to the `config.json` file. (e.g. "C:/Users/user/Desktop/SGnlp test/senticgcnbert" instead of "C:/Users/user/Desktop/SGnlp test/senticgcnbert/config.json"

As a last resort, may I advise that you use the `eval.py` code directly from the GitHub repository and replaced the `_create_model` method here, https://github.com/aisingapore/sgnlp/blob/main/sgnlp/models/sentic_gcn/eval.py#L67

With your hardcoded full path to your config file path and model file path as follows and try to run the script again?

```

def _created_model(...):

    config = config_class.from_pretrained("C:\\Users\\user\\Desktop\\SGnlp test\\senticgcnbert\\config.json")

    model = model_class.from_pretrained("C:\\Users\\user\\Desktop\\SGnlp test\\senticgcnbert\\pytorch_model.bin")

    return model

```

I will follow up again once I am able to replicate the issue. My apologies again.

Reply
Page 2 / 3
Share: