lihaoliu-cambridge / mtmr-net

[TMI'19 & DLMIA'18] Code for "Multi-Task Deep Learning with Margin Ranking Loss for Lung Nodule Analysis".
44 stars 12 forks source link

constructorError in yaml file #4

Closed Sakshiwala closed 3 years ago

Sakshiwala commented 3 years ago

I am getting this error while ruuning the code

raise ConstructorError(None, None, yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple' in "./conf/log.yaml", line 32, column 18

Kindly please help me understand and solve the error

lihaoliu-cambridge commented 3 years ago

I am getting this error while ruuning the code

raise ConstructorError(None, None, yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple' in "./conf/log.yaml", line 32, column 18

Kindly please help me understand and solve the error

Hi, thanks for your question. But the provided information is not enough to locate the bug. Could you please provide more details?

Sakshiwala commented 3 years ago

Sorry for the delay and thanks for the response.

Sir I am facing below problem, while running python main.py command Screenshot (19)

Please help

lihaoliu-cambridge commented 3 years ago

Sorry for the delay and thanks for the response.

Sir I am facing below problem, while running python main.py command Screenshot (19)

Please help

Hi, the error happens in "yaml.safe_load()" function. I believe it is because your yaml version is too high. I suggest you degrade it to yaml 3.13.

Sakshiwala commented 3 years ago

Sorry for the delay and thanks for the response. Sir I am facing below problem, while running python main.py command Screenshot (19) Please help

Hi, the error happens in "yaml.safe_load()" function. I believe it is because your yaml version is too high. I suggest you degrade it to yaml 3.13.

Sir I degraded the yaml version to 3.13 but it did not solve the problem. What can I do next?

lihaoliu-cambridge commented 3 years ago

What

Hi, the bug is located, which is the YAML's deserialize function. So I believe it is an easy problem to solve.

I recommend you first check your config file. Make sure there isn't any 'garbled character', 'tab', or 'blank space' included.

Second, you can run a small tutorial test case (attached below) for YAML to see if the safe_load function is working so you can better locate the error.

------------ test code ------------ import yaml import io

data = { 'a list': [ 1, 42, 3.141, 1337, 'help', u'€' ], 'a string': 'bla', 'another dict': { 'foo': 'bar', 'key': 'value', 'the answer': 42 } }

with io.open('data.yaml', 'w', encoding='utf8') as outfile: yaml.dump(data, outfile, default_flow_style=False, allow_unicode=True)

with open("data.yaml", 'r') as stream: data_loaded = yaml.safe_load(stream)

print(data == data_loaded)

Sakshiwala commented 3 years ago

Thank you for giving your time sir. I will try this solution. Thank you again.

On Tue, Feb 9, 2021, 17:47 Liu Lihao notifications@github.com wrote:

What

Hi, the bug is located, which is the YAML's deserialize function. So I believe it is an easy problem to solve.

I recommend you first check your config file. Make sure there isn't any 'garbled character', 'tab', or 'blank space' included.

Second, you can run a small tutorial test case (attached below) for YAML to see if the safe_load function is working so you can better locate the error.

------------ test code ------------ -- coding: utf-8 --

import yaml import io Define data

data = { 'a list': [ 1, 42, 3.141, 1337, 'help', u'€' ], 'a string': 'bla', 'another dict': { 'foo': 'bar', 'key': 'value', 'the answer': 42 } } Write YAML file

with io.open('data.yaml', 'w', encoding='utf8') as outfile: yaml.dump(data, outfile, default_flow_style=False, allow_unicode=True) Read YAML file

with open("data.yaml", 'r') as stream: data_loaded = yaml.safe_load(stream)

print(data == data_loaded)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lihaoliu-cambridge/mtmr-net/issues/4#issuecomment-775896014, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANSUDUUZTKAD24VQPTUXDRLS6ERUHANCNFSM4WYMU7HQ .