pytorch-pcnn icon indicating copy to clipboard operation
pytorch-pcnn copied to clipboard

Something Wrong

Open charlesfufu opened this issue 6 years ago • 43 comments

image

charlesfufu avatar Oct 16 '18 04:10 charlesfufu

Hi, file is only in Python 2.7X, and your python version is 3.6. You can try replace file into open

ShomyLiu avatar Oct 16 '18 04:10 ShomyLiu

Hi, file is only in Python 2.7X, and your python version is 3.6. You can try replace file into open

image How about this one?

charlesfufu avatar Oct 16 '18 04:10 charlesfufu

The training phase should be in this way in the terminal:

python main_sem.py  train

If you run code in IDE (e.g., Pycharm) , You can modify the __main__ function with:

if __name__ == "__main__":
     train()

ShomyLiu avatar Oct 16 '18 05:10 ShomyLiu

The training phase should be in this way in the terminal:

python main_sem.py  train

If you run code in IDE (e.g., Pycharm) , You can modify the __main__ function with:

if __name__ == "__main__":
     train()

According to what you say, get the same result.

charlesfufu avatar Oct 16 '18 05:10 charlesfufu

The normal output of main_sem should be: image

Maybe the environment difference?

ShomyLiu avatar Oct 16 '18 06:10 ShomyLiu

def train(**kwargs): image Where is the value of the parameter?

charlesfufu avatar Oct 16 '18 06:10 charlesfufu

The normal output of main_sem should be: image

Maybe the environment difference?

Maybe you should upgrade your program with python3

charlesfufu avatar Oct 16 '18 06:10 charlesfufu

The normal output of main_sem should be: image Maybe the environment difference?

Maybe you should upgrade your program with python3

image I don't know if you write program like these *** if name == "main": train()***,how to pass in the value at def train(**kwargs) function ?

charlesfufu avatar Oct 16 '18 06:10 charlesfufu

OK, I will update my code with Python3.X. You can change config.py Line 66:

.iteritems()   ->   .items()
```
Maybe there will be other codes different from python2.x and 3.x

ShomyLiu avatar Oct 16 '18 07:10 ShomyLiu

OK, I will update my code with Python3.X. You can change config.py Line 66:

.iteritems()   ->   .items()

Maybe there will be other codes different from python2.x and 3.x

Yes, I had found at least four difference between python2 and python3. Looking forward to your code with python3. Thanks! !

charlesfufu avatar Oct 16 '18 07:10 charlesfufu

Yes, I'm trying to update with python3. And I think it would be better with Pytorch 0.4 or later in the revision.

ShomyLiu avatar Oct 16 '18 07:10 ShomyLiu

The normal output of main_sem should be: image Maybe the environment difference?

Maybe you should upgrade your program with python3

image I don't know if you write program like these *** if name == "main": train()***,how to pass in the value at def train(**kwargs) function ?

image I can not run the part program of picture. Do you know what's reason causes these? my pytorch version is 0.4

charlesfufu avatar Oct 16 '18 08:10 charlesfufu

Yeah. My code is in Pytorch0.3. I'm updating code into Python3.x and Pytorch 0.4

ShomyLiu avatar Oct 16 '18 08:10 ShomyLiu

@charlesfufu The code has updated. the master branch is under Python 3.5x and Pytorch 0.4+.

ShomyLiu avatar Oct 16 '18 10:10 ShomyLiu

@charlesfufu The code has updated. the master branch is under Python 3.5x and Pytorch 0.4+.

Wonderful !!

charlesfufu avatar Oct 16 '18 10:10 charlesfufu

@charlesfufu The code has updated. the master branch is under Python 3.5x and Pytorch 0.4+.

Wonderful !!

image Do you know why?

charlesfufu avatar Oct 16 '18 10:10 charlesfufu

try changing the "use_gpu" in config.py to False.

Wangpeiyi9979 avatar Oct 16 '18 10:10 Wangpeiyi9979

try changing the "use_gpu" in config.py to False.

still wrong

charlesfufu avatar Oct 16 '18 10:10 charlesfufu

Is the same wrong message?

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

Is the same wrong message?

yeah!!Maybe is not GPU problem.

charlesfufu avatar Oct 16 '18 11:10 charlesfufu

image try changing the codes here to this

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

image try changing the codes here to this

image No,that's wrong.

charlesfufu avatar Oct 16 '18 11:10 charlesfufu

image this?

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

image also change the code here, and add long(). it may work

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

image

No, not right Can I ask you about it, have you run it since the program was modified?

charlesfufu avatar Oct 16 '18 11:10 charlesfufu

image

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

@Wangpeiyi9979 what about win10 ?

charlesfufu avatar Oct 16 '18 11:10 charlesfufu

@Wangpeiyi9979 what about win10 ? it should work. changing the code here, add long().. image

and here image

Wangpeiyi9979 avatar Oct 16 '18 11:10 Wangpeiyi9979

@ShomyLiu

charlesfufu avatar Oct 16 '18 12:10 charlesfufu

@charlesfufu I have reviewed code carefully and cannot reproduce your problems either in GPU or CPU. Please check your environments.
My environments are listed here:

- OS: Ubuntu 16.04 
- Python: 3.5
- Pytorch: 0.4.1
- GPU: NVIDIA GTX 1080Ti with 387.34 drivers.

ShomyLiu avatar Oct 16 '18 13:10 ShomyLiu