Kylin9511 / CRNet

Channel Reconstruction Network implemented in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

虽然您的README已经写的很详细了,但是我使用argparse很少,所以运行有一点错误,但暂时还不知道错误在哪里!!

zhuwenxing opened this issue · comments

wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~/下载/home$ tree
.
├── COST2100
│   ├── A128.mat
│   ├── A32.mat
│   ├── A512.mat
│   ├── A64.mat
│   ├── DATA_HtestFin_all.mat
│   ├── DATA_HtestFout_all.mat
│   ├── DATA_Htestin.mat
│   ├── DATA_Htestout.mat
│   ├── DATA_Htrainin.mat
│   ├── DATA_Htrainout.mat
│   ├── DATA_Hvalin.mat
│   └── DATA_Hvalout.mat
├── CRNet
│   ├── dataset
│   │   ├── cost2100.py
│   │   └── __init__.py
│   ├── LICENSE
│   ├── main.py
│   ├── models
│   │   ├── crnet.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   │       ├── crnet.cpython-36.pyc
│   │       └── __init__.cpython-36.pyc
│   ├── README.md
│   └── utils
│       ├── __init__.py
│       ├── init.py
│       ├── logger.py
│       ├── parser.py
│       ├── __pycache__
│       │   ├── __init__.cpython-36.pyc
│       │   ├── init.cpython-36.pyc
│       │   ├── logger.cpython-36.pyc
│       │   ├── scheduler.cpython-36.pyc
│       │   ├── solver.cpython-36.pyc
│       │   └── statics.cpython-36.pyc
│       ├── scheduler.py
│       ├── solver.py
│       └── statics.py
└── Experiments
    ├── checkpoints
    │   ├── in_04.pth
    │   ├── in_08.pth
    │   ├── in_16.pth
    │   ├── in_32.pth
    │   ├── in_64.pth
    │   ├── out_04.pth
    │   ├── out_08.pth
    │   ├── out_16.pth
    │   ├── out_32.pth
    │   └── out_64.pth
    ├── log.out
    └── run.sh

这个是文件目录,在推测阶段,有如下错误:

wxzhu@sunlaoshilab-W560-G20-Invalid-entry-length-16-Fixed-up-to-11:~/下载/home/Experiments$ ./run.sh
Traceback (most recent call last):
  File "/home/wxzhu/下载/home/CRNet/main.py", line 4, in <module>
    from utils.parser import args
  File "/home/wxzhu/下载/home/CRNet/utils/__init__.py", line 5, in <module>
    from .solver import *
  File "/home/wxzhu/下载/home/CRNet/utils/solver.py", line 13, in <module>
    Result = namedtuple('Result', field, defaults=(None,) * len(field))
TypeError: namedtuple() got an unexpected keyword argument 'defaults'
./run.sh: 行 5: --evaluate: 未找到命令
./run.sh: 行 6: --batch-size: 未找到命令

run.sh文件如下:

python /home/wxzhu/下载/home/CRNet/main.py \
  --data-dir '/home/wxzhu/下载/home/COST2100' \
  --scenario 'in' \
  --pretrained '/home/wxzhu/下载/home/Experiments/checkpoints/in_04.pth' \  # Pretrained model loading
  --evaluate \  # Inference mode
  --batch-size 200 \
  --workers 0 \
  --cr 4 \
  --cpu \
  2>&1 | tee log.out

在将run.sh中的注释去掉后,

./run.sh: 行 5: --evaluate: 未找到命令
./run.sh: 行 6: --batch-size: 未找到命令

错误没有了,但是TypeError: namedtuple() got an unexpected keyword argument 'defaults'这个错误还是存在的!所以,希望可以添加一个config.py的文件来初始化参数,然后直接通过python main.py来执行!

@zhuwenxing

你好,感谢提出这个bug,确实使用多行命令的时候不能添加注释,我update一下。你最后遇到的这个TypeError,是因为你python版本没有满足readme里的要求导致的。更新到python3.7即可。

关于confiy.py的提议,其实执行接口都不重要,如果喜欢你可以自己修改。我提供的这个是一个bash脚本,利用sh run.sh执行即可。

好的,感谢你的回答!我的个人习惯是使用config.py,主要就是在使用VSCode调试的时候,会比较方便。