Comments (2)
TypeError: pad() missing 1 required positional argument: 'mode'
seems to be a persisting issue across different examples, the same environment cannot run the anomaly_detection.py example in /example folder either,
C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\dataset\jsonl.py:74: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int32 == np.dtype(int).type`.
if np.issubdtype(arg.dtype, int):
0%| | 0/100 [00:00<?, ?it/s]
Traceback (most recent call last):
File "anomaly_detection.py", line 48, in <module>
train_output = estimator.train_model(dataset.train)
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\model\estimator.py", line 219, in train_model
validation_iter=validation_data_loader,
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\trainer\_base.py", line 423, in __call__
num_batches_to_use=self.num_batches_per_epoch,
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\trainer\_base.py", line 275, in loop
for batch_no, batch in enumerate(it, start=1):
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\tqdm\std.py", line 1182, in __iter__
for obj in iterable:
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\itertools.py", line 420, in __iter__
yield from itertools.islice(self.iterable, self.length)
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 112, in __iter__
self.base_dataset, is_train=self.is_train
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 132, in __call__
for data_entry in data_it:
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\dataset\loader.py", line 50, in __call__
yield from batcher(data, self.batch_size)
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\itertools.py", line 131, in get_batch
return list(itertools.islice(it, batch_size))
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 132, in __call__
for data_entry in data_it:
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 188, in __call__
for result in self.flatmap_transform(data_entry.copy(), is_train):
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 161, in flatmap_transform
yield self._split_instance(entry, idx)
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 134, in _split_instance
past_piece, future_piece = self._split_array(entry[ts_field], idx)
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 118, in _split_array
value=self.dummy_value,
File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\zebras\_util.py", line 50, in pad_axis
return np.pad(a, pad_width, constant_values=value)
TypeError: pad() missing 1 required positional argument: 'mode'
from gluonts.
Anaconda seems to not work, I managed to bypass this by using docker.
This is my requirements.txt
numpy==1.23.5
matplotlib==3.8.2
gluonts==0.14.3
mxnet==1.6.0
orjson==3.9.7
my Dockerfile
# Use an official Python runtime as a parent image
FROM python:3.9.18-bullseye
# Update and install required dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y bash libstdc++6 libgomp1 build-essential
# Install Fortran compiler
RUN apt-get install -y gfortran
# Install musl
RUN apt-get install -y musl
# Set the working directory to /app
WORKDIR /app
# Install any needed packages specified in requirements.txt
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . .
# Make port 3000 available to the world outside this container
EXPOSE 3000
# Run app.py when the container launches
CMD ["python3", "app.py"]
my docker-compose.yml
version: '3'
services:
app:
container_name: app
build:
context: .
ports:
- "3000:3000"
command: [ "python3", "app.py" ]
networks:
- data-stack
volumes:
- .:/app/
networks:
# External network
data-stack:
external: true
since docker does not go well with interactive GUI plotting, I also changed all plt.show() into
# Save the figure to a file
plt.savefig("plot2.png")
plt.close()
Now I can run the example!
For anyone who has same issue, try the exact version above in docker
from gluonts.
Related Issues (20)
- Unify QuantileOutput and DistributionOutput
- Unify the design of seq2seq PyTorch models
- Add support for all covariate types to all PyTorch models
- Change of behaviour from lightning logger HOT 2
- BUG No module named 'gluonts.torch.model.i_transformer' HOT 1
- The annotation of the parameter device of PyTorchPredictor is incomplete HOT 2
- Dataframe index is not uniformly spaced. If your dataframe contains data from multiple series in the same column ("long" format), consider constructing the dataset with `PandasDataset.from_long_dataframe` instead. HOT 1
- get_aggregate_metrics() returns `inf` for MSIS and MASE when just a single target series in the dataset is invariant across time
- Consolidate R methods HOT 3
- AssertionError: Dataframe index is not uniformly spaced. HOT 1
- Unexpected Requirement for Prediction Horizon Feature Values with use_feat_dynamic_real=True in Predict Function HOT 1
- mxnet version is not compatible with jupyter notebook in Ananconda
- Cannot script PyTorch model
- Issue with frequency since pandas 2.2.0 in the DeepAREstimator HOT 4
- gluonts.torch.distributions.BinnedUniformsOutput raises AttributeError
- add millisecond L and microsecond U support in `time_feature` HOT 1
- TypeError while using PiecewiseLinearOutput as distribution output with torch version GluonTS 0.14.3
- Cannot use iTransformer with GluonTS version 0.14.4 HOT 2
- Support pydantic-2.5.3 HOT 2
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 gluonts.