Comments (5)
I have the same problem, anyone has any advice?
from stackgan-pytorch.
@314rated @Wentong-DST have you solved the problem, cuz I'm trying to solve it too
from stackgan-pytorch.
You can load val_captions.t7 with torchfile.load(val_captions.t7).
It's a torchfile.hashable_unique_dict with two keys: raw_txt (a list texts) and fea_txt (a list of embeddings each of size 1024).
If you already have your custom embeddings you just have to follow that structure. I wanted to use python and not lua so torchfile.hashable_unique_dict was not appropriate. I used a regular dict instead and changed trainer.py at line 243 as:
t_file = torchfile.load(datapath)
<<t_file = torch.load(datapath)
captions_list = t_file.raw_txt
<<captions_list = t_file['raw_txt']
embeddings = np.concatenate(t_file.fea_txt, axis=0)
<<embeddings = np.concatenate(t_file['fea_txt'], axis=0)
This worked, but I would still be curious on how to generate the char-CNN-RNN text embeddings.
from stackgan-pytorch.
You can load val_captions.t7 with torchfile.load(val_captions.t7).
It's a torchfile.hashable_unique_dict with two keys: raw_txt (a list texts) and fea_txt (a list of embeddings each of size 1024).If you already have your custom embeddings you just have to follow that structure. I wanted to use python and not lua so torchfile.hashable_unique_dict was not appropriate. I used a regular dict instead and changed trainer.py at line 243 as:
t_file = torchfile.load(datapath)
<<t_file = torch.load(datapath)
captions_list = t_file.raw_txt
<<captions_list = t_file['raw_txt']
embeddings = np.concatenate(t_file.fea_txt, axis=0)
<<embeddings = np.concatenate(t_file['fea_txt'], axis=0)This worked, but I would still be curious on how to generate the char-CNN-RNN text embeddings.
Is there any way to select only a few of the captions and embeddings from the val_captions.t7?
Also, I am getting the following error when I try your solution:
Traceback (most recent call last):
File "main.py", line 77, in <module>
algo.sample(datapath, cfg.STAGE)
File "C:\Users\hunte\OneDrive\Documents\Projects\EAD Project\StackGAN-Pytorch-master\code\trainer.py", line 242, in sample
t_file = torch.load(datapath)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 387, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 564, in _load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '�'.
from stackgan-pytorch.
You can load val_captions.t7 with torchfile.load(val_captions.t7).
It's a torchfile.hashable_unique_dict with two keys: raw_txt (a list texts) and fea_txt (a list of embeddings each of size 1024).If you already have your custom embeddings you just have to follow that structure. I wanted to use python and not lua so torchfile.hashable_unique_dict was not appropriate. I used a regular dict instead and changed trainer.py at line 243 as:
t_file = torchfile.load(datapath)
<<t_file = torch.load(datapath)
captions_list = t_file.raw_txt
<<captions_list = t_file['raw_txt']
embeddings = np.concatenate(t_file.fea_txt, axis=0)
<<embeddings = np.concatenate(t_file['fea_txt'], axis=0)This worked, but I would still be curious on how to generate the char-CNN-RNN text embeddings.
do you have a val_captions.t7 file,Icannot find this file and do not know the contents of this file...So i cannot eval my training result.Thank you!
from stackgan-pytorch.
Related Issues (20)
- ImportError: cannot import name FileWriter HOT 1
- How to preprocess char-CNN-RNN? HOT 4
- Link to preprocessed char-CNN-RNN text embeddings for birds is down
- Generator loss
- ImportError: cannot import name 'FileWriter' from 'tensorboard' HOT 4
- OSError: [Errno 22] Invalid argument HOT 7
- Output images aligned?
- I don't have the oxford_flower model of stageI_G for pytorch HOT 2
- Work on Windows 10? HOT 3
- cuda runtime error
- Error: Parameter to MergeFrom() must be instance of same class:
- How to match the generated images with the caption?
- some loss keep increase HOT 1
- Inconsistent with the paper (Stage-II inputs) HOT 1
- How to create new image using my own sentence as input?
- access denied HOT 1
- Why the text condition input of netD is `mu`? HOT 2
- Ues 'mu' as "conditional augmentation" and pass it to Discriminator?
- Steps to train on a new dataset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stackgan-pytorch.