Skip to content

two errors in \site-packages\pracmln\wcsp\wcsp.py when import MLN #34

@NewBerd

Description

@NewBerd

when I import MLN, I have two errors.

  1. the package has no filepath 3rdparty\toulbar2-0.9.7.0\AMD64\Windows\toulbar2.exe , but 3rdparty\toulbar2-0.9.7.0\x86_64\Windows\toulbar2.exe. whereas in methods:
def toulbar2_path():
    (osname, _, _, _, arch, _) = platform.uname()
    # 此处需要修改为x86_64,因为上面获取的为amd64,但是库中的路径却是x86_64
    arch = "x86_64"
    execname = 'toulbar2'
    en = is_executable(execname)
    if en is not None: # use the version in PATH if it can be found
        return en
    # fallback: try to load shipped toulbar2 binary
    if osname == 'Windows': execname += '.exe'
    return os.path.join('3rdparty', 'toulbar2-{}'.format(toulbar_version), arch, osname, execname)
  1. sys.stdout has no attribute buffer:
    line 135
# 此处也需要修改,因为标准输出流中没有buffer,是直接使用的
def write(self, stream=sys.stdout):
    stream.write('{} {} {} {}\n'.format(len(self.variables), ' '.join(map(str, self.variables)), self.defcost, len(self.tuples)).encode())
    for t in list(self.tuples.keys()):
        stream.write('{} {}\n'.format(' '.join(map(str, t)), self.tuples[t]).encode())

the same as line 232

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions