0

I trying to implement it GitHub project based on deep learning and project is on linked in (https://github.com/xing-hu/EMSE-DeepCom?files=1).

I keep getting the error :

Traceback (most recent call last):

File "__main__.py", line 329, in <module>
    main()
  File "__main__.py", line 126, in main
    with open('../config/default.yaml') as f:
FileNotFoundError: [Errno 2] No such file or directory: '../config/default.yaml'
tjinpa2019@cloudshell:~/EMSE-DeepCom/source code (bamboo-truck-281120)$

the code of line 126 is

def main(args=None):
args = parser.parse_args(args)

# read config file and default config
with open('../config/default.yaml') as f:
    default_config = utils.AttrDict(yaml.safe_load(f))

with open(args.config) as f:
    config = utils.AttrDict(yaml.safe_load(f))

Can any one help me in this as I am stuck in this problem for quite sometime

khelwood
  • 55,782
  • 14
  • 81
  • 108
  • Paths in Python should be handled using `os`, which has the necessary abstractions for the path separators (`/` vs `\\`) and also handy methods to resolve relative paths. Try using the code from https://stackoverflow.com/a/7166139/1843468 – LWChris Jul 01 '20 at 22:37
  • @LWChris Thanks for the reply will try that ... – Tenzin Jinpa Jul 01 '20 at 22:39
  • @LWChris : its giving me the same error after I replace ..\config\default.yaml.......error is No such file or directory: '..\\config\\default.yaml' – Tenzin Jinpa Jul 01 '20 at 22:42
  • Have you used the code in the linked answer to convert it into an absolute path? – LWChris Jul 01 '20 at 22:56
  • @LWChirs: I had change the ../config/default.yaml ' to config.yaml'. since I am running the get hub code : python3 __main__.py config.yaml --train -v to train the model and copied both the file at current location – Tenzin Jinpa Jul 01 '20 at 23:02
  • and now its giving me error File "__main__.py", line 183, in main log_path = os.path.join(config.model_dir, config.log_file) File "/Users/tenzinjinpa/opt/anaconda3/lib/python3.7/posixpath.py", line 94, in join genericpath._check_arg_types('join', a, *p) File "/Users/tenzinjinpa/opt/anaconda3/lib/python3.7/genericpath.py", line 153, in _check_arg_types – Tenzin Jinpa Jul 01 '20 at 23:04
  • @LWChris : think the problem is reading ../config/default.yaml as system think that / means directory in fact what I want is to treat them both as one file. Any idea how to do that and to avoid the absolute path I copied both the file in current directory. But still its giving me the same problem as it treat it / as directory – Tenzin Jinpa Jul 01 '20 at 23:31
  • I found the solution...I had to create the directory and just copy the files from the linked file that was provided ! Thanks for everyone for the help \ – Tenzin Jinpa Jul 02 '20 at 21:28

0 Answers0