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

SequenceClassification.py does not work out of box #3875

Open
HaomingYu1997 opened this issue Dec 5, 2022 · 1 comment
Open

SequenceClassification.py does not work out of box #3875

HaomingYu1997 opened this issue Dec 5, 2022 · 1 comment

Comments

@HaomingYu1997
Copy link

HaomingYu1997 commented Dec 5, 2022

I use Visual Studio 2022 to run the SequenceClassification.py.
The Python version I am using is 3.6.8, the CNTK version is cntk-gpu-2.7.
However, when I run the program these errors came up:

About to throw exception 'Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.'
attempt: Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open., retrying 2-th time out of 5...

About to throw exception 'Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.'
attempt: Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open., retrying 3-th time out of 5...

About to throw exception 'Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.'
attempt: Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open., retrying 4-th time out of 5...

About to throw exception 'Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.'
attempt: Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open., retrying 5-th time out of 5...

About to throw exception 'Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.'
Input file 'F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt' is not open.

The call stacks are

[CALL STACK]
    > 00007FFEF35CD7DB (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFEF35CEB5D (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFEF35D5B28 (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFEF35CE055 (SymFromAddr() error: Attempt to access invalid address.)
    - CreateDeserializer
    - CreateCompositeDataReader (x3)
    - CNTK::  UniversalLearner
    - CNTK::  CreateCompositeMinibatchSource
    - PyInit__cntk_py
    - PyCFunction_FastCallDict
    - PyObject_GetAttr
    - PyEval_EvalFrameDefault
    - PyObject_Free
    - PyFunction_FastCallDict

Stack trace:

Stack trace:
 >  File "F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\LSTM_GloVe.py", line 17, in create_reader
 >    )), randomize=is_training,max_sweeps=INFINITELY_REPEAT if is_training else 1)
 >  File "F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\LSTM_GloVe.py", line 52, in train_sequence_classifier
 >    reader = create_reader(path, True, input_dim, num_output_classes)
 >  File "F:\purdue\2022_Fall\ECE_62900\final_project\LSTM_GloVe\LSTM_GloVe.py", line 78, in <module> (Current frame)
 >    error, _ = train_sequence_classifier()
Loaded 'cntk.io'
Loaded '__main__'
Loaded 'runpy'
The program 'python.exe' has exited with code 0 (0x0).

I have looked at issue #2999. The suggestion is: In the path in your code, add .txt at the end, e.g. '../../Tests/EndToEndTests/Image/Data\Train_cntk_text.txt.txt'. This didn't work for me.

Are they any other suggestions?

@pat749
Copy link

pat749 commented Mar 26, 2023

The error message suggests that the input file "Train_cntk_text.txt.txt" cannot be found or opened. The path of the file seems to be incorrect since it contains duplicate ".txt" extensions. You may want to check the file path and make sure it is correct.
Additionally, you may want to try using an absolute file path instead of a relative path. To do so, you can use the os module to get the absolute path of the file as follows:

import os

file_path = "Train_cntk_text.txt.txt"
abs_path = os.path.abspath(file_path)

# pass abs_path to your CNTK code

This will give you the absolute path of the file, which you can use to load the data in your CNTK code.

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